GVariant: Add g_variant_parse_error_quark()
authorMurray Cumming <murrayc@murrayc.com>
Tue, 17 Sep 2013 09:10:28 +0000 (11:10 +0200)
committerRyan Lortie <desrt@desrt.ca>
Sun, 22 Dec 2013 16:27:16 +0000 (11:27 -0500)
Most GErrors, such as GSomethingError, have a function to get
their quark that looks like g_something_error_quark(),
so bindings (such as gtkmm) would expect GVariantParseError
to have g_variant_parse_error_quark(). Instead this had
g_variant_parser_get_error_quark().
This deprecates the old function and adds the correct one,
making life easier for gtkmm (and maybe others).

https://bugzilla.gnome.org/show_bug.cgi?id=708212

docs/reference/glib/glib-sections.txt
glib/gvariant-parser.c
glib/gvariant.h

index cf67661..e8b6bfe 100644 (file)
@@ -3232,6 +3232,7 @@ g_variant_new_parsed_va
 g_variant_new_parsed
 
 <SUBSECTION Private>
+g_variant_parse_error_quark
 g_variant_parser_get_error_quark
 g_variant_type_checked_
 </SECTION>
index de140d0..44bec57 100644 (file)
  *
  * Error codes returned by parsing text-format GVariants.
  **/
-G_DEFINE_QUARK (g-variant-parse-error-quark, g_variant_parser_get_error)
+G_DEFINE_QUARK (g-variant-parse-error-quark, g_variant_parse_error)
+
+/**
+ * Deprecated: Use g_variant_parse_error_quark() instead.
+ */
+GQuark
+g_variant_parser_get_error_quark (void)
+{
+  return g_variant_parse_error_quark ();
+}
 
 typedef struct
 {
index dbace86..7baff89 100644 (file)
@@ -323,12 +323,15 @@ typedef enum
   G_VARIANT_PARSE_ERROR_UNTERMINATED_STRING_CONSTANT,
   G_VARIANT_PARSE_ERROR_VALUE_EXPECTED
 } GVariantParseError;
-#define G_VARIANT_PARSE_ERROR (g_variant_parser_get_error_quark ())
+#define G_VARIANT_PARSE_ERROR (g_variant_parse_error_quark ())
 
-GLIB_AVAILABLE_IN_ALL
+GLIB_DEPRECATED_IN_2_38_FOR(g_variant_parse_error_quark)
 GQuark                          g_variant_parser_get_error_quark        (void);
 
 GLIB_AVAILABLE_IN_ALL
+GQuark                          g_variant_parse_error_quark             (void);
+
+GLIB_AVAILABLE_IN_ALL
 GVariantBuilder *               g_variant_builder_new                   (const GVariantType   *type);
 GLIB_AVAILABLE_IN_ALL
 void                            g_variant_builder_unref                 (GVariantBuilder      *builder);