TpAccount *account = TP_ACCOUNT (source_object);
GError *error = NULL;
- if (!tp_account_prepare_finish (account, result, &error))
+ if (!tp_proxy_prepare_finish (account, result, &error))
{
DEBUG ("Failed to prepare account: %s", error->message);
g_error_free (error);
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))
+ if (!tp_proxy_prepare_finish (manager, result, &error))
{
DEBUG ("Failed to prepare account manager: %s", error->message);
g_clear_error (&error);
return;
}
- if (account_id != NULL)
+ account_manager_prepared = TRUE;
+
+ if (selected_account_name != NULL)
{
gchar *account_path;
TpAccount *account = NULL;
/* 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);
+ if (g_str_has_prefix (selected_account_name, TP_ACCOUNT_OBJECT_PATH_BASE))
+ account_path = g_strdup (selected_account_name);
+ else
+ account_path = g_strdup_printf ("%s%s", TP_ACCOUNT_OBJECT_PATH_BASE,
+ selected_account_name);
+
bus = tp_dbus_daemon_dup (NULL);
if ((account = tp_account_new (bus, account_path, &error)))
{
- tp_account_prepare_async (account, NULL, account_prepare_cb, manager);
+ tp_proxy_prepare_async (account, NULL, account_prepare_cb, manager);
+ g_object_unref (bus);
return;
}
else
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);
else
{
maybe_show_accounts_ui (manager);
- account_manager_prepared = TRUE;
}
}
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)
g_object_unref (account_manager);
}
- g_strfreev (argv);
-
return 0;
}
g_set_application_name (_("Empathy Accounts"));
+ /* Make empathy and empathy-accounts appear as the same app in gnome-shell */
+ gdk_set_program_class ("Empathy");
gtk_window_set_default_icon_name ("empathy");
textdomain (GETTEXT_PACKAGE);
account_manager = tp_account_manager_dup ();
- tp_account_manager_prepare_async (account_manager, NULL,
- account_manager_ready_for_accounts_cb, selected_account_name);
+ 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);