diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-10-26 16:02:01 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-10-26 17:21:59 +0800 |
commit | 3cb7d4dcb966dfa5ed391cc0b5aee1cc6f05f5b6 (patch) | |
tree | 7510dc392c3b0f854220fbca0cea18dc1d6bee3f | |
parent | 35c8dca4f051944b011ef8c0843548a10be9117b (diff) | |
download | gsoc2013-empathy-3cb7d4dcb966dfa5ed391cc0b5aee1cc6f05f5b6.tar gsoc2013-empathy-3cb7d4dcb966dfa5ed391cc0b5aee1cc6f05f5b6.tar.gz gsoc2013-empathy-3cb7d4dcb966dfa5ed391cc0b5aee1cc6f05f5b6.tar.bz2 gsoc2013-empathy-3cb7d4dcb966dfa5ed391cc0b5aee1cc6f05f5b6.tar.lz gsoc2013-empathy-3cb7d4dcb966dfa5ed391cc0b5aee1cc6f05f5b6.tar.xz gsoc2013-empathy-3cb7d4dcb966dfa5ed391cc0b5aee1cc6f05f5b6.tar.zst gsoc2013-empathy-3cb7d4dcb966dfa5ed391cc0b5aee1cc6f05f5b6.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
-rw-r--r-- | src/empathy-accounts.c | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/src/empathy-accounts.c b/src/empathy-accounts.c index de28f7ae5..7cd5fe79c 100644 --- a/src/empathy-accounts.c +++ b/src/empathy-accounts.c @@ -54,7 +54,11 @@ static gboolean only_if_needed = FALSE; static gboolean hidden = FALSE; static gchar *selected_account_name = NULL; +<<<<<<< HEAD static gboolean account_manager_prepared = FALSE; +======= +static gboolean assistant = FALSE; +>>>>>>> cf3a9f5... empathy-accounts: prepare the AM in app_command_line_cb static void maybe_show_accounts_ui (TpAccountManager *manager) @@ -102,8 +106,6 @@ account_manager_ready_for_accounts_cb (GObject *source_object, return; } - account_manager_prepared = TRUE; - if (selected_account_name != NULL) { gchar *account_path; @@ -147,20 +149,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, - 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; } @@ -218,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; @@ -246,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; |