From 0dee35404acfb0113dd4506eafa84b2682071577 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Wed, 16 May 2012 13:15:12 +0200 Subject: [PATCH] tp_simple/automatic_client_factory_new: allow NULL TpDBusDaemon https://bugs.freedesktop.org/show_bug.cgi?id=49372 --- telepathy-glib/automatic-client-factory.c | 5 +++-- telepathy-glib/simple-client-factory.c | 8 +++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/telepathy-glib/automatic-client-factory.c b/telepathy-glib/automatic-client-factory.c index b2cc10a..6620138 100644 --- a/telepathy-glib/automatic-client-factory.c +++ b/telepathy-glib/automatic-client-factory.c @@ -288,9 +288,10 @@ tp_automatic_client_factory_class_init (TpAutomaticClientFactoryClass *cls) /** * tp_automatic_client_factory_new: - * @dbus: a #TpDBusDaemon + * @dbus: (allow-none): a #TpDBusDaemon, or %NULL * - * Returns a new #TpAutomaticClientFactory instance. + * Returns a new #TpAutomaticClientFactory instance. If @dbus is %NULL, + * tp_dbus_daemon_dup() will be used. * * Returns: a new #TpAutomaticClientFactory * diff --git a/telepathy-glib/simple-client-factory.c b/telepathy-glib/simple-client-factory.c index 51b9221..7d00b75 100644 --- a/telepathy-glib/simple-client-factory.c +++ b/telepathy-glib/simple-client-factory.c @@ -312,7 +312,8 @@ tp_simple_client_factory_constructed (GObject *object) { TpSimpleClientFactory *self = (TpSimpleClientFactory *) object; - g_assert (TP_IS_DBUS_DAEMON (self->priv->dbus)); + if (self->priv->dbus == NULL) + self->priv->dbus = tp_dbus_daemon_dup (NULL); G_OBJECT_CLASS (tp_simple_client_factory_parent_class)->constructed (object); } @@ -398,9 +399,10 @@ tp_simple_client_factory_class_init (TpSimpleClientFactoryClass *klass) /** * tp_simple_client_factory_new: - * @dbus: a #TpDBusDaemon + * @dbus: (allow-none): a #TpDBusDaemon, or %NULL * - * Creates a new #TpSimpleClientFactory instance. + * Creates a new #TpSimpleClientFactory instance. If @dbus is %NULL, + * tp_dbus_daemon_dup() will be used. * * Returns: a new #TpSimpleClientFactory * -- 1.7.9.5