[empathy] Don't pass managers to create_salut_account_if_needed
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [empathy] Don't pass managers to create_salut_account_if_needed
- Date: Tue, 19 Jan 2010 16:11:36 +0000 (UTC)
commit 902b24c56151985da6eadedc748803d686a07a62
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Tue Jan 19 14:54:46 2010 +0000
Don't pass managers to create_salut_account_if_needed
It can dup it itself.
src/empathy-auto-salut-account-helper.c | 24 +++++++++++++++++++++---
src/empathy-auto-salut-account-helper.h | 2 +-
src/empathy.c | 3 +--
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 a6bbf88..30842dd 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 6e93450..8cec7b8 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 60ff6c0..1d25e92 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]