aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-accounts-common.c
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2010-03-02 02:59:38 +0800
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>2010-03-02 02:59:42 +0800
commitb0de7c5d5d8c93dd7b74a77b4892c331f37f5441 (patch)
tree8c63a77afe624bb20a49c6afd6a86e47704e6a5d /src/empathy-accounts-common.c
parent886357ee6af17fe37523337209a09aa6f3112604 (diff)
downloadgsoc2013-empathy-b0de7c5d5d8c93dd7b74a77b4892c331f37f5441.tar
gsoc2013-empathy-b0de7c5d5d8c93dd7b74a77b4892c331f37f5441.tar.gz
gsoc2013-empathy-b0de7c5d5d8c93dd7b74a77b4892c331f37f5441.tar.bz2
gsoc2013-empathy-b0de7c5d5d8c93dd7b74a77b4892c331f37f5441.tar.lz
gsoc2013-empathy-b0de7c5d5d8c93dd7b74a77b4892c331f37f5441.tar.xz
gsoc2013-empathy-b0de7c5d5d8c93dd7b74a77b4892c331f37f5441.tar.zst
gsoc2013-empathy-b0de7c5d5d8c93dd7b74a77b4892c331f37f5441.zip
Make the empathy-account code be slightly more streamlined
On every run of the accounts UI we should try to import MC4 accounts (if they weren't imported already). Also replace the --try-import option with --if-needed to better document the fact that it will only display the UI if needed.
Diffstat (limited to 'src/empathy-accounts-common.c')
-rw-r--r--src/empathy-accounts-common.c56
1 files changed, 1 insertions, 55 deletions
diff --git a/src/empathy-accounts-common.c b/src/empathy-accounts-common.c
index cf730fab2..ff9c8c438 100644
--- a/src/empathy-accounts-common.c
+++ b/src/empathy-accounts-common.c
@@ -111,7 +111,7 @@ do_show_accounts_ui (TpAccountManager *manager,
gtk_window_present (GTK_WINDOW (accounts_window));
}
-static GtkWidget*
+static GtkWidget *
show_account_assistant (EmpathyConnectionManagers *connection_mgrs,
GCallback assistant_destroy_cb)
{
@@ -125,60 +125,6 @@ show_account_assistant (EmpathyConnectionManagers *connection_mgrs,
}
static void
-connection_managers_prepare_cb (
- EmpathyConnectionManagers *cm_mgr,
- GAsyncResult *result,
- gpointer user_data)
-{
- GCallback assistant_destroy_cb = g_object_get_data (G_OBJECT (cm_mgr),
- "assistant-destroy-callback");
- TpAccountManager *account_mgr = g_object_get_data (G_OBJECT (cm_mgr),
- "account-manager");
- gboolean hidden = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (cm_mgr),
- "hidden"));
-
- if (!empathy_connection_managers_prepare_finish (cm_mgr, result, NULL))
- goto out;
-
- if (empathy_accounts_import (account_mgr, cm_mgr) &&
- !hidden)
- {
- show_account_assistant (cm_mgr, assistant_destroy_cb);
- }
- else if (!empathy_accounts_has_non_salut_accounts (account_mgr))
- {
- show_account_assistant (cm_mgr, assistant_destroy_cb);
- }
- else
- {
- if (assistant_destroy_cb)
- assistant_destroy_cb ();
- }
-
-out:
- g_object_unref (cm_mgr);
-}
-
-void
-empathy_accounts_manager_ready_for_show_assistant (
- TpAccountManager *account_mgr,
- gboolean hidden)
-{
- EmpathyConnectionManagers *cm_mgr;
-
- cm_mgr = empathy_connection_managers_dup_singleton ();
-
- g_object_set_data (G_OBJECT (cm_mgr), "assistant-destroy-callback",
- g_object_get_data (G_OBJECT (account_mgr), "assistant-destroy-callback"));
- g_object_set_data_full (G_OBJECT (cm_mgr), "account-manager",
- g_object_ref (account_mgr), g_object_unref);
- g_object_set_data (G_OBJECT (cm_mgr), "hidden", GUINT_TO_POINTER (hidden));
-
- empathy_connection_managers_prepare_async (cm_mgr,
- (GAsyncReadyCallback) connection_managers_prepare_cb, NULL);
-}
-
-static void
connection_managers_prepare_for_accounts (GObject *source,
GAsyncResult *result,
gpointer user_data)