[empathy/gnome-3-2] empathy-accounts: prepare the AM in app_command_line_cb
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy/gnome-3-2] empathy-accounts: prepare the AM in app_command_line_cb
- Date: Wed, 26 Oct 2011 09:25:04 +0000 (UTC)
commit 3cb7d4dcb966dfa5ed391cc0b5aee1cc6f05f5b6
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Wed Oct 26 10:02:01 2011 +0200
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
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 de28f7a..7cd5fe7 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]