aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Barisione <marco@barisione.org>2009-07-20 20:25:23 +0800
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-07-22 01:41:04 +0800
commit68dcc8dcce232a4e8c803bd6cc71052c473f9203 (patch)
treea294226fe19fab84be0eff9bd966c20b486e7c27
parente9266689e7b55d9be53afc46c5b3d131ba9837cd (diff)
downloadgsoc2013-empathy-68dcc8dcce232a4e8c803bd6cc71052c473f9203.tar
gsoc2013-empathy-68dcc8dcce232a4e8c803bd6cc71052c473f9203.tar.gz
gsoc2013-empathy-68dcc8dcce232a4e8c803bd6cc71052c473f9203.tar.bz2
gsoc2013-empathy-68dcc8dcce232a4e8c803bd6cc71052c473f9203.tar.lz
gsoc2013-empathy-68dcc8dcce232a4e8c803bd6cc71052c473f9203.tar.xz
gsoc2013-empathy-68dcc8dcce232a4e8c803bd6cc71052c473f9203.tar.zst
gsoc2013-empathy-68dcc8dcce232a4e8c803bd6cc71052c473f9203.zip
Use the account manager when the service is running, not when we receive NameOwnerChanged
-rw-r--r--libempathy/empathy-account-manager.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/libempathy/empathy-account-manager.c b/libempathy/empathy-account-manager.c
index 692b4f05a..7df1a80b7 100644
--- a/libempathy/empathy-account-manager.c
+++ b/libempathy/empathy-account-manager.c
@@ -25,6 +25,7 @@
#include <telepathy-glib/account-manager.h>
#include <telepathy-glib/enums.h>
#include <telepathy-glib/defs.h>
+#include <telepathy-glib/dbus.h>
#include <telepathy-glib/interfaces.h>
#include "empathy-account-manager.h"
@@ -45,7 +46,6 @@ typedef struct {
int connecting;
gboolean dispose_run;
gboolean ready;
- TpProxySignalConnection *proxy_signal;
TpAccountManager *tp_manager;
TpDBusDaemon *dbus;
@@ -322,18 +322,16 @@ account_manager_got_all_cb (TpProxy *proxy,
}
static void
-account_manager_name_owner_changed_cb (TpDBusDaemon *proxy,
- const gchar *arg0,
- const gchar *arg1,
- const gchar *arg2,
- gpointer user_data,
- GObject *weak_object)
+account_manager_name_owner_cb (TpDBusDaemon *proxy,
+ const gchar *name,
+ const gchar *new_owner,
+ gpointer user_data)
{
- EmpathyAccountManager *manager = EMPATHY_ACCOUNT_MANAGER (weak_object);
+ EmpathyAccountManager *manager = EMPATHY_ACCOUNT_MANAGER (user_data);
EmpathyAccountManagerPriv *priv = GET_PRIV (manager);
- tp_proxy_signal_connection_disconnect (priv->proxy_signal);
- priv->proxy_signal = NULL;
+ tp_dbus_daemon_cancel_name_owner_watch (proxy, name,
+ account_manager_name_owner_cb, user_data);
priv->tp_manager = tp_account_manager_new (priv->dbus);
tp_cli_dbus_properties_call_get_all (priv->tp_manager, -1,
@@ -362,12 +360,10 @@ empathy_account_manager_init (EmpathyAccountManager *manager)
priv->dbus = tp_dbus_daemon_dup (NULL);
- priv->proxy_signal = tp_cli_dbus_daemon_connect_to_name_owner_changed (
- priv->dbus,
- account_manager_name_owner_changed_cb,
+ tp_dbus_daemon_watch_name_owner (priv->dbus,
TP_ACCOUNT_MANAGER_BUS_NAME,
- NULL,
- G_OBJECT (manager),
+ account_manager_name_owner_cb,
+ manager,
NULL);
/* trigger MC5 starting */
@@ -405,6 +401,9 @@ do_dispose (GObject *obj)
priv->dispose_run = TRUE;
+ tp_dbus_daemon_cancel_name_owner_watch (priv->dbus,
+ TP_ACCOUNT_MANAGER_BUS_NAME, account_manager_name_owner_cb, manager);
+
if (priv->dbus == NULL)
g_object_unref (priv->dbus);
priv->dbus = NULL;