diff options
author | Murray Cumming <murrayc@murrayc.com> | 2013-09-17 11:10:28 +0200 |
---|---|---|
committer | Ryan Lortie <desrt@desrt.ca> | 2013-12-22 11:27:16 -0500 |
commit | eeac91f866939fd033303f34c7eb9d2b57c769fb (patch) | |
tree | e4821895c24f5cb317246ca7a6ba4b14335a3040 | |
parent | 864d960d756e3be0a857875337b7e6b520298b78 (diff) |
GVariant: Add g_variant_parse_error_quark()
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
-rw-r--r-- | docs/reference/glib/glib-sections.txt | 1 | ||||
-rw-r--r-- | glib/gvariant-parser.c | 11 | ||||
-rw-r--r-- | glib/gvariant.h | 7 |
3 files changed, 16 insertions, 3 deletions
diff --git a/docs/reference/glib/glib-sections.txt b/docs/reference/glib/glib-sections.txt index cf67661e0..e8b6bfeb2 100644 --- a/docs/reference/glib/glib-sections.txt +++ b/docs/reference/glib/glib-sections.txt @@ -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> diff --git a/glib/gvariant-parser.c b/glib/gvariant-parser.c index de140d0a5..44bec579e 100644 --- a/glib/gvariant-parser.c +++ b/glib/gvariant-parser.c @@ -71,7 +71,16 @@ * * 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 { diff --git a/glib/gvariant.h b/glib/gvariant.h index dbace869e..7baff8950 100644 --- a/glib/gvariant.h +++ b/glib/gvariant.h @@ -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); |