summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.co.uk>2012-05-16 13:15:12 +0200
committerXavier Claessens <xavier.claessens@collabora.co.uk>2012-05-23 10:00:38 +0200
commit947b96fd587d13f657077f7e3479fb135bf38858 (patch)
treea06d71f95f98288ed716a97fcdd05abeb5274c53
parente54e1dd4fd5a09fd02d1cbf278eb615c1edeed36 (diff)
tp_simple/automatic_client_factory_new: allow NULL TpDBusDaemon
https://bugs.freedesktop.org/show_bug.cgi?id=49372
-rw-r--r--telepathy-glib/automatic-client-factory.c5
-rw-r--r--telepathy-glib/simple-client-factory.c8
2 files changed, 8 insertions, 5 deletions
diff --git a/telepathy-glib/automatic-client-factory.c b/telepathy-glib/automatic-client-factory.c
index b2cc10ab3..6620138ca 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 51b922114..7d00b7547 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
*