[telepathy-mission-control/master] McdDispatcher: move skeletal get_channel_filter_cb into McdClientProxy
Simon McVittie
simon.mcvittie at collabora.co.uk
Wed Sep 23 10:43:56 PDT 2009
---
src/mcd-client-priv.h | 4 ++--
src/mcd-client.c | 19 +++++++++++++------
src/mcd-dispatcher.c | 18 ++----------------
3 files changed, 17 insertions(+), 24 deletions(-)
diff --git a/src/mcd-client-priv.h b/src/mcd-client-priv.h
index 794527f..d86af94 100644
--- a/src/mcd-client-priv.h
+++ b/src/mcd-client-priv.h
@@ -115,8 +115,8 @@ typedef enum
MCD_CLIENT_OBSERVER
} McdClientInterface;
-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_get_channel_filter_cb (TpProxy *proxy,
+ const GValue *value, const GError *error, gpointer user_data, GObject *o);
G_GNUC_INTERNAL void _mcd_client_proxy_handler_get_all_cb (
TpProxy *proxy, GHashTable *properties, const GError *error,
diff --git a/src/mcd-client.c b/src/mcd-client.c
index f8cf7ba..504317f 100644
--- a/src/mcd-client.c
+++ b/src/mcd-client.c
@@ -643,27 +643,34 @@ finally:
}
void
-_mcd_client_proxy_set_channel_filters (McdClientProxy *self,
- const GValue *value,
- const GError *error,
- McdClientInterface iface)
+_mcd_client_proxy_get_channel_filter_cb (TpProxy *proxy,
+ const GValue *value,
+ const GError *error,
+ gpointer user_data,
+ GObject *o G_GNUC_UNUSED)
{
+ McdClientProxy *self = MCD_CLIENT_PROXY (proxy);
+ McdClientInterface iface = GPOINTER_TO_UINT (user_data);
+
if (error != NULL)
{
DEBUG ("error getting a filter list for client %s: %s #%d: %s",
tp_proxy_get_object_path (self),
g_quark_to_string (error->domain), error->code, error->message);
- return;
+ goto finally;
}
if (!G_VALUE_HOLDS (value, TP_ARRAY_TYPE_STRING_VARIANT_MAP_LIST))
{
DEBUG ("wrong type for filter property on client %s: %s",
tp_proxy_get_object_path (self), G_VALUE_TYPE_NAME (value));
- return;
+ goto finally;
}
_mcd_client_proxy_set_filters (self, iface, g_value_get_boxed (value));
+
+finally:
+ _mcd_client_proxy_dec_ready_lock (self);
}
gboolean
diff --git a/src/mcd-dispatcher.c b/src/mcd-dispatcher.c
index a6e4152..3a77df3 100644
--- a/src/mcd-dispatcher.c
+++ b/src/mcd-dispatcher.c
@@ -1865,20 +1865,6 @@ mcd_dispatcher_release_startup_lock (McdDispatcher *self)
}
static void
-get_channel_filter_cb (TpProxy *proxy,
- const GValue *value,
- const GError *error,
- gpointer user_data,
- GObject *weak_object)
-{
- McdClientProxy *client = MCD_CLIENT_PROXY (proxy);
-
- _mcd_client_proxy_set_channel_filters (client, value, error,
- GPOINTER_TO_UINT (user_data));
- _mcd_client_proxy_dec_ready_lock (client);
-}
-
-static void
mcd_dispatcher_update_client_caps (McdDispatcher *self,
McdClientProxy *client)
{
@@ -1948,7 +1934,7 @@ get_interfaces_cb (TpProxy *proxy,
tp_cli_dbus_properties_call_get
(client, -1, TP_IFACE_CLIENT_APPROVER,
- "ApproverChannelFilter", get_channel_filter_cb,
+ "ApproverChannelFilter", _mcd_client_proxy_get_channel_filter_cb,
GUINT_TO_POINTER (MCD_CLIENT_APPROVER), NULL, NULL);
}
@@ -1971,7 +1957,7 @@ get_interfaces_cb (TpProxy *proxy,
tp_cli_dbus_properties_call_get
(client, -1, TP_IFACE_CLIENT_OBSERVER,
- "ObserverChannelFilter", get_channel_filter_cb,
+ "ObserverChannelFilter", _mcd_client_proxy_get_channel_filter_cb,
GUINT_TO_POINTER (MCD_CLIENT_OBSERVER), NULL, NULL);
}
--
1.5.6.5
More information about the telepathy-commits
mailing list