aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-accounts.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-10-26 16:02:01 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-10-26 17:02:51 +0800
commitcf3a9f53216213720c3551c8e1833fc4eb971fe0 (patch)
tree39e22ecd15fa3f2bcae18ed7a4a13b7dbf73e67f /src/empathy-accounts.c
parent08d8020862035a1d8f4e41a31b10dcde870d8b73 (diff)
downloadgsoc2013-empathy-cf3a9f53216213720c3551c8e1833fc4eb971fe0.tar
gsoc2013-empathy-cf3a9f53216213720c3551c8e1833fc4eb971fe0.tar.gz
gsoc2013-empathy-cf3a9f53216213720c3551c8e1833fc4eb971fe0.tar.bz2
gsoc2013-empathy-cf3a9f53216213720c3551c8e1833fc4eb971fe0.tar.lz
gsoc2013-empathy-cf3a9f53216213720c3551c8e1833fc4eb971fe0.tar.xz
gsoc2013-empathy-cf3a9f53216213720c3551c8e1833fc4eb971fe0.tar.zst
gsoc2013-empathy-cf3a9f53216213720c3551c8e1833fc4eb971fe0.zip
empathy-accounts: prepare the AM in app_command_line_cb
We just need to prepare it in the main instance; there is no point doing it the other ones as they will just re-invoke the main one and exit. https://bugzilla.gnome.org/show_bug.cgi?id=662504
Diffstat (limited to 'src/empathy-accounts.c')
-rw-r--r--src/empathy-accounts.c28
1 files changed, 6 insertions, 22 deletions
diff --git a/src/empathy-accounts.c b/src/empathy-accounts.c
index d3cdf2a50..fa6b6b26f 100644
--- a/src/empathy-accounts.c
+++ b/src/empathy-accounts.c
@@ -54,7 +54,6 @@
static gboolean only_if_needed = FALSE;
static gboolean hidden = FALSE;
static gchar *selected_account_name = NULL;
-static gboolean account_manager_prepared = FALSE;
static gboolean assistant = FALSE;
static void
@@ -103,8 +102,6 @@ account_manager_ready_for_accounts_cb (GObject *source_object,
return;
}
- account_manager_prepared = TRUE;
-
if (selected_account_name != NULL)
{
gchar *account_path;
@@ -148,20 +145,16 @@ static int
app_command_line_cb (GApplication *app,
GApplicationCommandLine *cmdline)
{
+ TpAccountManager *account_manager;
+
g_application_hold (app);
- /* if the window is ready, present it; otherwise, it will be presented when
- * the accounts manager is prepared */
- if (account_manager_prepared)
- {
- TpAccountManager *account_manager;
+ account_manager = tp_account_manager_dup ();
- account_manager = tp_account_manager_dup ();
- empathy_accounts_show_accounts_ui (account_manager, NULL, assistant,
- G_CALLBACK (gtk_main_quit));
+ tp_proxy_prepare_async (account_manager, NULL,
+ account_manager_ready_for_accounts_cb, NULL);
- g_object_unref (account_manager);
- }
+ g_object_unref (account_manager);
return 0;
}
@@ -223,12 +216,9 @@ local_cmdline (GApplication *app,
return retval;
}
-#define COMMAND_ACCOUNTS_DIALOG 1
-
int
main (int argc, char *argv[])
{
- TpAccountManager *account_manager;
GtkApplication *app;
GObjectClass *app_class;
gint retval;
@@ -251,17 +241,11 @@ main (int argc, char *argv[])
app_class = G_OBJECT_GET_CLASS (app);
G_APPLICATION_CLASS (app_class)->local_command_line = local_cmdline;
- account_manager = tp_account_manager_dup ();
-
- tp_proxy_prepare_async (account_manager, NULL,
- account_manager_ready_for_accounts_cb, NULL);
-
g_signal_connect (app, "command-line", G_CALLBACK (app_command_line_cb),
NULL);
retval = g_application_run (G_APPLICATION (app), argc, argv);
- g_object_unref (account_manager);
g_object_unref (app);
return retval;