From c37cf9e49636d8d5c94998f078c457c025fa561c Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 2 Aug 2010 13:51:33 +0100 Subject: [PATCH] Introspect TpError We need to duplicate tp_errors_quark() as tp_error_quark() so that g-ir-scanner picks up the relationship between the quark and error enum. The new quark function returns the same quark as the old one. Closes: bfo#29358 --- docs/reference/telepathy-glib-sections.txt | 5 ++- telepathy-glib/errors.c | 33 +++++++++++++++++++++++++-- telepathy-glib/errors.h | 5 ++- telepathy-glib/introspection.am | 1 + 4 files changed, 37 insertions(+), 7 deletions(-) diff --git a/docs/reference/telepathy-glib-sections.txt b/docs/reference/telepathy-glib-sections.txt index 397e350..60aba30 100644 --- a/docs/reference/telepathy-glib-sections.txt +++ b/docs/reference/telepathy-glib-sections.txt @@ -1899,7 +1899,7 @@ tp_dbus_properties_mixin_flags_get_type telepathy-glib/errors.h errors TP_ERROR_PREFIX -TP_ERRORS +TP_ERROR TP_TYPE_ERROR TpError tp_g_set_error_invalid_handle_type @@ -1947,8 +1947,9 @@ TP_ERROR_STR_WOULD_BREAK_ANONYMITY tp_error_get_type tp_errors_quark +tp_error_quark -TP_ERROR +TP_ERRORS
diff --git a/telepathy-glib/errors.c b/telepathy-glib/errors.c index 267d2c5..048e08c 100644 --- a/telepathy-glib/errors.c +++ b/telepathy-glib/errors.c @@ -35,7 +35,7 @@ */ /** - * TP_ERRORS: + * TP_ERROR: * * The error domain for the D-Bus errors described in the Telepathy * specification. Error codes in this domain come from the #TpError @@ -45,6 +45,11 @@ * domain. Since 0.7.17, this function automatically registers the domain with * dbus-glib for server-side use (using dbus_g_error_domain_register()) when * called. + * + * This used to be called %TP_ERRORS. To be compatible with telepathy-glib + * 0.10.x, use %TP_ERRORS. + * + * Since: 0.11.UNRELEASED */ /** @@ -177,7 +182,7 @@ */ /** - * tp_g_set_error_invalid_handle_type: + * tp_g_set_error_invalid_handle_type: (skip) * @type: An invalid handle type * @error: Either %NULL, or used to return an error (as for g_set_error) * @@ -195,7 +200,7 @@ tp_g_set_error_invalid_handle_type (guint type, GError **error) } /** - * tp_g_set_error_unsupported_handle_type: + * tp_g_set_error_unsupported_handle_type: (skip) * @type: An unsupported handle type * @error: Either %NULL, or used to return an error (as for g_set_error) * @@ -226,13 +231,35 @@ tp_g_set_error_unsupported_handle_type (guint type, GError **error) * tools/glib-errors-str-gen.py. */ +/** + * tp_errors_quark: (skip) + * + * + * + * Deprecated: Use tp_error_quark() instead. + */ GQuark tp_errors_quark (void) { + return tp_error_quark (); +} + +/** + * tp_error_quark: + * + * Return the error domain quark for #TpError. + * + * Since: 0.11.UNRELEASED + */ +GQuark +tp_error_quark (void) +{ static gsize quark = 0; if (g_once_init_enter (&quark)) { + /* FIXME: When we next break API, this should be changed to + * "tp-error-quark" */ GQuark domain = g_quark_from_static_string ("tp_errors"); g_type_init (); diff --git a/telepathy-glib/errors.h b/telepathy-glib/errors.h index 6bbb13b..9034bd3 100644 --- a/telepathy-glib/errors.h +++ b/telepathy-glib/errors.h @@ -29,11 +29,12 @@ G_BEGIN_DECLS GQuark tp_errors_quark (void); +GQuark tp_error_quark (void); #define TP_ERROR_PREFIX "org.freedesktop.Telepathy.Error" -#define TP_ERRORS (tp_errors_quark ()) -#define TP_ERROR TP_ERRORS +#define TP_ERRORS TP_ERROR +#define TP_ERROR (tp_error_quark ()) void tp_g_set_error_invalid_handle_type (guint type, GError **error); void tp_g_set_error_unsupported_handle_type (guint type, GError **error); diff --git a/telepathy-glib/introspection.am b/telepathy-glib/introspection.am index ceecfde..e72a623 100644 --- a/telepathy-glib/introspection.am +++ b/telepathy-glib/introspection.am @@ -35,6 +35,7 @@ INTROSPECTION_FILES = \ $(srcdir)/protocol.c $(srcdir)/protocol.h \ $(srcdir)/base-connection.c $(srcdir)/base-connection.h \ $(srcdir)/handle-repo.c $(srcdir)/handle-repo.h $(srcdir)/handle-set.c \ + $(srcdir)/errors.c $(srcdir)/errors.h \ _gen/telepathy-enums.h \ _gen/telepathy-interfaces.h -- 1.7.2