summaryrefslogtreecommitdiff
path: root/telepathy-glib/dbus.c
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2009-06-10 15:19:47 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2009-06-10 15:21:55 +0100
commitc85d9262108a830d0dee3b42ef73e9691e3ecdac (patch)
treefb37ffa1fd36bfc2e27bafda315beb0705651fb1 /telepathy-glib/dbus.c
parent103d0afb4369bee6123e15b4f4d4d1b95061d70e (diff)
downloadtelepathy-glib-c85d9262108a830d0dee3b42ef73e9691e3ecdac.tar.gz
TpConnectionManager, TpDBusDaemon, media interfaces: make safe to extend
As with TpChannel, a function like tp_connection_manager_init_known_interfaces needs to be called before you add signals, to ensure that extensions correctly override code in telepathy-glib itself.
Diffstat (limited to 'telepathy-glib/dbus.c')
-rw-r--r--telepathy-glib/dbus.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/telepathy-glib/dbus.c b/telepathy-glib/dbus.c
index 7ae06ba93..1e1bc3bf8 100644
--- a/telepathy-glib/dbus.c
+++ b/telepathy-glib/dbus.c
@@ -1264,20 +1264,47 @@ tp_dbus_daemon_dispose (GObject *object)
G_OBJECT_CLASS (tp_dbus_daemon_parent_class)->dispose (object);
}
+/**
+ * tp_dbus_daemon_init_known_interfaces:
+ *
+ * Ensure that the known interfaces for TpDBusDaemon have been set up.
+ * This is done automatically when necessary, but for correct
+ * overriding of library interfaces by local extensions, you should
+ * call this function before calling
+ * tp_proxy_or_subclass_hook_on_interface_add() with first argument
+ * %TP_TYPE_DBUS_DAEMON.
+ *
+ * Since: 0.7.UNRELEASED
+ */
+void
+tp_dbus_daemon_init_known_interfaces (void)
+{
+ static gsize once = 0;
+
+ if (g_once_init_enter (&once))
+ {
+ tp_proxy_init_known_interfaces ();
+ tp_proxy_or_subclass_hook_on_interface_add (TP_TYPE_DBUS_DAEMON,
+ tp_cli_dbus_daemon_add_signals);
+
+ g_once_init_leave (&once, 1);
+ }
+}
+
static void
tp_dbus_daemon_class_init (TpDBusDaemonClass *klass)
{
TpProxyClass *proxy_class = (TpProxyClass *) klass;
GObjectClass *object_class = (GObjectClass *) klass;
+ tp_dbus_daemon_init_known_interfaces ();
+
g_type_class_add_private (klass, sizeof (TpDBusDaemonPrivate));
object_class->constructor = tp_dbus_daemon_constructor;
object_class->dispose = tp_dbus_daemon_dispose;
proxy_class->interface = TP_IFACE_QUARK_DBUS_DAEMON;
- tp_proxy_or_subclass_hook_on_interface_add (TP_TYPE_DBUS_DAEMON,
- tp_cli_dbus_daemon_add_signals);
}
/* Auto-generated implementation of _tp_register_dbus_glib_marshallers */