From 9b0203d1d07927bcaf826947bf21b08f93e30871 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. --- telepathy-glib/errors.c | 34 +++++++++++++++++++++++++++++++--- telepathy-glib/errors.h | 1 + telepathy-glib/introspection.am | 1 + 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/telepathy-glib/errors.c b/telepathy-glib/errors.c index 267d2c5..03f4d8f 100644 --- a/telepathy-glib/errors.c +++ b/telepathy-glib/errors.c @@ -177,7 +177,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 +195,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) * @@ -213,7 +213,7 @@ tp_g_set_error_unsupported_handle_type (guint type, GError **error) } /** - * tp_error_get_dbus_name: + * tp_error_get_dbus_name: (skip) * @error: a member of the #TpError enum. * * @@ -226,6 +226,9 @@ tp_g_set_error_unsupported_handle_type (guint type, GError **error) * tools/glib-errors-str-gen.py. */ +/** + * tp_errors_quark: (skip) + */ GQuark tp_errors_quark (void) { @@ -244,5 +247,30 @@ tp_errors_quark (void) return (GQuark) quark; } +/** + * tp_error_quark: + * + * Same as tp_errors_quark() for introspection purposes. + * + * Since: 0.11.12 + */ +GQuark +tp_error_quark (void) +{ + static gsize quark = 0; + + if (g_once_init_enter (&quark)) + { + GQuark domain = g_quark_from_static_string ("tp_errors"); + + g_type_init (); + dbus_g_error_domain_register (domain, TP_ERROR_PREFIX, + TP_TYPE_ERROR); + g_once_init_leave (&quark, domain); + } + + return (GQuark) quark; +} + /* tp_errors_quark assumes this */ G_STATIC_ASSERT (sizeof (GQuark) <= sizeof (gsize)); diff --git a/telepathy-glib/errors.h b/telepathy-glib/errors.h index 6bbb13b..606a1b6 100644 --- a/telepathy-glib/errors.h +++ b/telepathy-glib/errors.h @@ -29,6 +29,7 @@ G_BEGIN_DECLS GQuark tp_errors_quark (void); +GQuark tp_error_quark (void); #define TP_ERROR_PREFIX "org.freedesktop.Telepathy.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