aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-auto-salut-account-helper.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-01-19 22:54:46 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-01-20 00:11:11 +0800
commit902b24c56151985da6eadedc748803d686a07a62 (patch)
tree9e36aa50254e52ee8c83f151b9c391ad3d537429 /src/empathy-auto-salut-account-helper.c
parent452df1568e0a3e74a49c92c00840e15c788215ce (diff)
downloadgsoc2013-empathy-902b24c56151985da6eadedc748803d686a07a62.tar
gsoc2013-empathy-902b24c56151985da6eadedc748803d686a07a62.tar.gz
gsoc2013-empathy-902b24c56151985da6eadedc748803d686a07a62.tar.bz2
gsoc2013-empathy-902b24c56151985da6eadedc748803d686a07a62.tar.lz
gsoc2013-empathy-902b24c56151985da6eadedc748803d686a07a62.tar.xz
gsoc2013-empathy-902b24c56151985da6eadedc748803d686a07a62.tar.zst
gsoc2013-empathy-902b24c56151985da6eadedc748803d686a07a62.zip
Don't pass managers to create_salut_account_if_needed
It can dup it itself.
Diffstat (limited to 'src/empathy-auto-salut-account-helper.c')
-rw-r--r--src/empathy-auto-salut-account-helper.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/empathy-auto-salut-account-helper.c b/src/empathy-auto-salut-account-helper.c
index a6bbf88d9..30842dd43 100644
--- a/src/empathy-auto-salut-account-helper.c
+++ b/src/empathy-auto-salut-account-helper.c
@@ -201,15 +201,33 @@ create_salut_account_am_ready_cb (GObject *source_object,
g_object_unref (managers);
}
-void
-create_salut_account_if_needed (EmpathyConnectionManagers *managers)
+static void
+create_salut_account_cms_ready_cb (EmpathyConnectionManagers *managers)
{
TpAccountManager *manager;
manager = tp_account_manager_dup ();
tp_account_manager_prepare_async (manager, NULL,
- create_salut_account_am_ready_cb, g_object_ref (managers));
+ create_salut_account_am_ready_cb, managers);
g_object_unref (manager);
}
+
+void
+create_salut_account_if_needed (void)
+{
+ EmpathyConnectionManagers *managers;
+
+ managers = empathy_connection_managers_dup_singleton ();
+
+ if (empathy_connection_managers_is_ready (managers))
+ {
+ create_salut_account_cms_ready_cb (managers);
+ }
+ else
+ {
+ g_signal_connect (managers, "notify::ready",
+ G_CALLBACK (create_salut_account_cms_ready_cb), NULL);
+ }
+}