aboutsummaryrefslogtreecommitdiffstats
path: root/src
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
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')
-rw-r--r--src/empathy-auto-salut-account-helper.c24
-rw-r--r--src/empathy-auto-salut-account-helper.h2
-rw-r--r--src/empathy.c3
3 files changed, 23 insertions, 6 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);
+ }
+}
diff --git a/src/empathy-auto-salut-account-helper.h b/src/empathy-auto-salut-account-helper.h
index 6e934500b..8cec7b8ff 100644
--- a/src/empathy-auto-salut-account-helper.h
+++ b/src/empathy-auto-salut-account-helper.h
@@ -28,7 +28,7 @@
#include <libempathy/empathy-connection-managers.h>
-void create_salut_account_if_needed (EmpathyConnectionManagers *managers);
+void create_salut_account_if_needed (void);
gboolean should_create_salut_account (TpAccountManager *manager);
diff --git a/src/empathy.c b/src/empathy.c
index 60ff6c0cd..1d25e9247 100644
--- a/src/empathy.c
+++ b/src/empathy.c
@@ -208,9 +208,8 @@ check_connection_managers_ready (EmpathyConnectionManagers *managers)
if (!empathy_import_mc4_accounts (managers) && !start_hidden)
maybe_show_account_assistant ();
- create_salut_account_if_needed (managers);
+ create_salut_account_if_needed ();
g_object_unref (managers);
- managers = NULL;
return TRUE;
}
return FALSE;