[Pkg-telepathy-commits] [telepathy-mission-control-6] 37/90: Use tp_dbus_daemon_register_object to register object paths

Simon McVittie smcv at debian.org
Wed May 14 12:09:02 UTC 2014


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch debian
in repository telepathy-mission-control-6.

commit 7656a2404fb46aa6ecc805352aadb38cb615a03b
Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Tue Mar 18 19:47:15 2014 +0000

    Use tp_dbus_daemon_register_object to register object paths
    
    Also make sure to register object paths before their corresponding
    bus names.
---
 src/mcd-account-manager.c    |  8 ++++----
 src/mcd-account.c            |  9 ++-------
 src/mcd-dispatch-operation.c | 12 ++----------
 src/mcd-dispatcher.c         |  8 ++------
 4 files changed, 10 insertions(+), 27 deletions(-)

diff --git a/src/mcd-account-manager.c b/src/mcd-account-manager.c
index bc0a085..be4c96d 100644
--- a/src/mcd-account-manager.c
+++ b/src/mcd-account-manager.c
@@ -1498,6 +1498,10 @@ register_dbus_service (McdAccountManager *account_manager)
     if (priv->dbus_registered)
         return;
 
+    tp_dbus_daemon_register_object (priv->dbus_daemon,
+                                    TP_ACCOUNT_MANAGER_OBJECT_PATH,
+                                    account_manager);
+
     if (!tp_dbus_daemon_request_name (priv->dbus_daemon,
                                       TP_ACCOUNT_MANAGER_BUS_NAME,
                                       TRUE /* idempotent */, &error))
@@ -1511,10 +1515,6 @@ register_dbus_service (McdAccountManager *account_manager)
     }
 
     priv->dbus_registered = TRUE;
-
-    tp_dbus_daemon_register_object (priv->dbus_daemon,
-                                    TP_ACCOUNT_MANAGER_OBJECT_PATH,
-                                    account_manager);
 }
 
 static void
diff --git a/src/mcd-account.c b/src/mcd-account.c
index 2c4b273..6716e10 100644
--- a/src/mcd-account.c
+++ b/src/mcd-account.c
@@ -2733,7 +2733,6 @@ register_dbus_service (McdAccount *self,
                        const GError *error,
                        gpointer unused G_GNUC_UNUSED)
 {
-    DBusGConnection *dbus_connection;
     TpDBusDaemon *dbus_daemon;
 
     if (error != NULL)
@@ -2756,12 +2755,8 @@ register_dbus_service (McdAccount *self,
     dbus_daemon = self->priv->dbus_daemon;
     g_return_if_fail (dbus_daemon != NULL);
 
-    dbus_connection = tp_proxy_get_dbus_connection (TP_PROXY (dbus_daemon));
-
-    if (G_LIKELY (dbus_connection))
-	dbus_g_connection_register_g_object (dbus_connection,
-					     self->priv->object_path,
-					     (GObject *) self);
+    tp_dbus_daemon_register_object (dbus_daemon, self->priv->object_path,
+        self);
 }
 
 /*
diff --git a/src/mcd-dispatch-operation.c b/src/mcd-dispatch-operation.c
index eb081d3..0bb0539 100644
--- a/src/mcd-dispatch-operation.c
+++ b/src/mcd-dispatch-operation.c
@@ -1108,21 +1108,13 @@ mcd_dispatch_operation_constructor (GType type, guint n_params,
     if (priv->needs_approval)
     {
         TpDBusDaemon *dbus_daemon;
-        DBusGConnection *dbus_connection;
 
         g_object_get (priv->client_registry,
                       "dbus-daemon", &dbus_daemon,
                       NULL);
 
-        /* can be NULL if we have fallen off the bus (in the real MC libdbus
-         * would exit in this situation, but in the debug build, we stay
-         * active briefly) */
-        dbus_connection = tp_proxy_get_dbus_connection (dbus_daemon);
-
-        if (G_LIKELY (dbus_connection != NULL))
-            dbus_g_connection_register_g_object (dbus_connection,
-                                                 priv->object_path, object);
-
+        tp_dbus_daemon_register_object (dbus_daemon, priv->object_path,
+            object);
         g_object_unref (dbus_daemon);
     }
 
diff --git a/src/mcd-dispatcher.c b/src/mcd-dispatcher.c
index 9639b2e..58aef9d 100644
--- a/src/mcd-dispatcher.c
+++ b/src/mcd-dispatcher.c
@@ -780,7 +780,6 @@ mcd_dispatcher_update_client_caps (McdDispatcher *self,
 static void
 mcd_dispatcher_constructed (GObject *object)
 {
-    DBusGConnection *dgc;
     McdDispatcherPrivate *priv = MCD_DISPATCHER_PRIV (object);
     GError *error = NULL;
 
@@ -793,7 +792,8 @@ mcd_dispatcher_constructed (GObject *object)
                       G_CALLBACK (mcd_dispatcher_client_registry_ready_cb),
                       object);
 
-    dgc = tp_proxy_get_dbus_connection (TP_PROXY (priv->dbus_daemon));
+    tp_dbus_daemon_register_object (priv->dbus_daemon,
+        TP_CHANNEL_DISPATCHER_OBJECT_PATH, object);
 
     if (!tp_dbus_daemon_request_name (priv->dbus_daemon,
                                       TP_CHANNEL_DISPATCHER_BUS_NAME,
@@ -806,10 +806,6 @@ mcd_dispatcher_constructed (GObject *object)
         g_error_free (error);
         exit (1);
     }
-
-    dbus_g_connection_register_g_object (dgc,
-                                         TP_CHANNEL_DISPATCHER_OBJECT_PATH,
-                                         object);
 }
 
 static void

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-telepathy/telepathy-mission-control-6.git



More information about the Pkg-telepathy-commits mailing list