diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-08-11 23:05:33 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-08-11 23:14:09 +0800 |
commit | 1c08a3a0b5538cc4e1b97535efd66f6f0d5146d5 (patch) | |
tree | fa73ee6665721c14cb822ce7fe0fde2bb2bb2f25 /libempathy | |
parent | dd4f24ee49d50145a30722010f6d849d36129c7c (diff) | |
download | gsoc2013-empathy-1c08a3a0b5538cc4e1b97535efd66f6f0d5146d5.tar gsoc2013-empathy-1c08a3a0b5538cc4e1b97535efd66f6f0d5146d5.tar.gz gsoc2013-empathy-1c08a3a0b5538cc4e1b97535efd66f6f0d5146d5.tar.bz2 gsoc2013-empathy-1c08a3a0b5538cc4e1b97535efd66f6f0d5146d5.tar.lz gsoc2013-empathy-1c08a3a0b5538cc4e1b97535efd66f6f0d5146d5.tar.xz gsoc2013-empathy-1c08a3a0b5538cc4e1b97535efd66f6f0d5146d5.tar.zst gsoc2013-empathy-1c08a3a0b5538cc4e1b97535efd66f6f0d5146d5.zip |
dispatcher: use tp_proxy_prepare_async instead of tp_connection_call_when_ready
Diffstat (limited to 'libempathy')
-rw-r--r-- | libempathy/empathy-dispatcher.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/libempathy/empathy-dispatcher.c b/libempathy/empathy-dispatcher.c index 9dceebfa8..557d435ec 100644 --- a/libempathy/empathy-dispatcher.c +++ b/libempathy/empathy-dispatcher.c @@ -266,15 +266,19 @@ dispatcher_connection_got_all (TpProxy *proxy, } static void -connection_ready_cb (TpConnection *connection, - const GError *error, +connection_prepare_cb (GObject *source, + GAsyncResult *result, gpointer user_data) { EmpathyDispatcher *self = EMPATHY_DISPATCHER (user_data); + GError *error = NULL; + TpConnection *connection = (TpConnection *) source; - if (error != NULL) + if (!tp_proxy_prepare_finish (source, result, &error)) { DEBUG ("Error: %s", error->message); + + g_error_free (error); goto out; } @@ -291,6 +295,8 @@ dispatcher_init_connection_if_needed (EmpathyDispatcher *self, TpConnection *connection) { EmpathyDispatcherPriv *priv = GET_PRIV (self); + GQuark features[] = { TP_CONNECTION_FEATURE_CORE, + 0 }; if (g_hash_table_lookup (priv->connections, connection) != NULL) return; @@ -301,10 +307,10 @@ dispatcher_init_connection_if_needed (EmpathyDispatcher *self, g_signal_connect (connection, "invalidated", G_CALLBACK (dispatcher_connection_invalidated_cb), self); - /* Ensure to keep the self object alive while the call_when_ready is - * running */ + /* Ensure to keep the self object alive while preparing the connection */ g_object_ref (self); - tp_connection_call_when_ready (connection, connection_ready_cb, self); + + tp_proxy_prepare_async (connection, features, connection_prepare_cb, self); } static void |