[telepathy-mission-control/master] _mcd_client_proxy_handler_get_all_cb: combine _mcd_client_proxy_set_handler_properties with the skeleton of the GetAll callback from McdDispatcher

Simon McVittie simon.mcvittie at collabora.co.uk
Wed Sep 23 10:38:40 PDT 2009


---
 src/mcd-client-priv.h |    5 +++--
 src/mcd-client.c      |   14 ++++++++++----
 src/mcd-dispatcher.c  |   21 ++++-----------------
 3 files changed, 17 insertions(+), 23 deletions(-)

diff --git a/src/mcd-client-priv.h b/src/mcd-client-priv.h
index 7cd8e07..794527f 100644
--- a/src/mcd-client-priv.h
+++ b/src/mcd-client-priv.h
@@ -118,8 +118,9 @@ typedef enum
 G_GNUC_INTERNAL void _mcd_client_proxy_set_channel_filters (McdClientProxy *self,
     const GValue *value, const GError *error, McdClientInterface iface);
 
-G_GNUC_INTERNAL void _mcd_client_proxy_set_handler_properties (
-    McdClientProxy *client, GHashTable *properties, const GError *error);
+G_GNUC_INTERNAL void _mcd_client_proxy_handler_get_all_cb (
+    TpProxy *proxy, GHashTable *properties, const GError *error,
+    gpointer p, GObject *o);
 
 G_GNUC_INTERNAL void _mcd_client_proxy_inc_ready_lock (McdClientProxy *self);
 G_GNUC_INTERNAL void _mcd_client_proxy_dec_ready_lock (McdClientProxy *self);
diff --git a/src/mcd-client.c b/src/mcd-client.c
index aa27d9b..f8cf7ba 100644
--- a/src/mcd-client.c
+++ b/src/mcd-client.c
@@ -567,10 +567,13 @@ _mcd_client_proxy_get_unique_name (McdClientProxy *self)
 }
 
 void
-_mcd_client_proxy_set_handler_properties (McdClientProxy *self,
-                                          GHashTable *properties,
-                                          const GError *error)
+_mcd_client_proxy_handler_get_all_cb (TpProxy *proxy,
+                                      GHashTable *properties,
+                                      const GError *error,
+                                      gpointer p G_GNUC_UNUSED,
+                                      GObject *o G_GNUC_UNUSED)
 {
+    McdClientProxy *self = MCD_CLIENT_PROXY (proxy);
     const gchar *bus_name = tp_proxy_get_bus_name (self);
     GPtrArray *filters;
     GPtrArray *handled_channels;
@@ -581,7 +584,7 @@ _mcd_client_proxy_set_handler_properties (McdClientProxy *self,
         DEBUG ("GetAll(Handler) for client %s failed: %s #%d: %s",
                bus_name, g_quark_to_string (error->domain), error->code,
                error->message);
-        return;
+        goto finally;
     }
 
     filters = tp_asv_get_boxed (properties, "HandlerChannelFilter",
@@ -634,6 +637,9 @@ _mcd_client_proxy_set_handler_properties (McdClientProxy *self,
             }
         }
     }
+
+finally:
+    _mcd_client_proxy_dec_ready_lock (self);
 }
 
 void
diff --git a/src/mcd-dispatcher.c b/src/mcd-dispatcher.c
index 75b7f08..a6e4152 100644
--- a/src/mcd-dispatcher.c
+++ b/src/mcd-dispatcher.c
@@ -1912,19 +1912,6 @@ mcd_dispatcher_update_client_caps (McdDispatcher *self,
 }
 
 static void
-handler_get_all_cb (TpProxy *proxy,
-                    GHashTable *properties,
-                    const GError *error,
-                    gpointer unused G_GNUC_UNUSED,
-                    GObject *weak_object)
-{
-    McdClientProxy *client = MCD_CLIENT_PROXY (proxy);
-
-    _mcd_client_proxy_set_handler_properties (client, properties, error);
-    _mcd_client_proxy_dec_ready_lock (client);
-}
-
-static void
 get_interfaces_cb (TpProxy *proxy,
                    const GValue *out_Value,
                    const GError *error,
@@ -1973,7 +1960,7 @@ get_interfaces_cb (TpProxy *proxy,
 
         tp_cli_dbus_properties_call_get_all
             (client, -1, TP_IFACE_CLIENT_HANDLER,
-             handler_get_all_cb, NULL, NULL, NULL);
+             _mcd_client_proxy_handler_get_all_cb, NULL, NULL, NULL);
     }
 
     if (tp_proxy_has_interface_by_id (proxy, TP_IFACE_QUARK_CLIENT_OBSERVER))
@@ -2033,9 +2020,9 @@ mcd_client_start_introspection (McdClientProxy *client,
                 _mcd_client_proxy_inc_ready_lock (client);
 
                 tp_cli_dbus_properties_call_get_all (client, -1,
-                                                     TP_IFACE_CLIENT_HANDLER,
-                                                     handler_get_all_cb,
-                                                     NULL, NULL, NULL);
+                    TP_IFACE_CLIENT_HANDLER,
+                    _mcd_client_proxy_handler_get_all_cb,
+                    NULL, NULL, NULL);
             }
             else
             {
-- 
1.5.6.5




More information about the telepathy-commits mailing list