aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-accounts.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/empathy-accounts.c')
-rw-r--r--src/empathy-accounts.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/empathy-accounts.c b/src/empathy-accounts.c
index 6d0561b14..05cb269c1 100644
--- a/src/empathy-accounts.c
+++ b/src/empathy-accounts.c
@@ -93,7 +93,6 @@ account_manager_ready_for_accounts_cb (GObject *source_object,
gpointer user_data)
{
TpAccountManager *manager = TP_ACCOUNT_MANAGER (source_object);
- const gchar *account_id = (const gchar*) user_data;
GError *error = NULL;
if (!tp_account_manager_prepare_finish (manager, result, &error))
@@ -103,7 +102,9 @@ account_manager_ready_for_accounts_cb (GObject *source_object,
return;
}
- if (account_id != NULL)
+ account_manager_prepared = TRUE;
+
+ if (selected_account_name != NULL)
{
gchar *account_path;
TpAccount *account = NULL;
@@ -112,7 +113,7 @@ account_manager_ready_for_accounts_cb (GObject *source_object,
/* create and prep the corresponding TpAccount so it's fully ready by the
* time we try to select it in the accounts dialog */
account_path = g_strdup_printf ("%s%s", TP_ACCOUNT_OBJECT_PATH_BASE,
- account_id);
+ selected_account_name);
bus = tp_dbus_daemon_dup (NULL);
if ((account = tp_account_new (bus, account_path, &error)))
{
@@ -124,6 +125,8 @@ account_manager_ready_for_accounts_cb (GObject *source_object,
DEBUG ("Failed to find account with path %s: %s", account_path,
error->message);
g_clear_error (&error);
+
+ maybe_show_accounts_ui (manager);
}
g_object_unref (bus);
@@ -132,7 +135,6 @@ account_manager_ready_for_accounts_cb (GObject *source_object,
else
{
maybe_show_accounts_ui (manager);
- account_manager_prepared = TRUE;
}
}
@@ -140,13 +142,8 @@ static int
app_command_line_cb (GApplication *app,
GApplicationCommandLine *cmdline)
{
- gchar **argv;
- gint argc;
-
g_application_hold (app);
- argv = g_application_command_line_get_arguments (cmdline, &argc);
-
/* if the window is ready, present it; otherwise, it will be presented when
* the accounts manager is prepared */
if (account_manager_prepared)
@@ -160,8 +157,6 @@ app_command_line_cb (GApplication *app,
g_object_unref (account_manager);
}
- g_strfreev (argv);
-
return 0;
}
@@ -247,7 +242,7 @@ main (int argc, char *argv[])
account_manager = tp_account_manager_dup ();
tp_account_manager_prepare_async (account_manager, NULL,
- account_manager_ready_for_accounts_cb, selected_account_name);
+ account_manager_ready_for_accounts_cb, NULL);
g_signal_connect (app, "command-line", G_CALLBACK (app_command_line_cb),
NULL);