aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-01-25 22:57:09 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-01-25 22:57:09 +0800
commit386ee2dc8453117ff1a2042ff0428a34d646b952 (patch)
treeca832b19fd0735a6c21410aad4037d7f9211c231 /src
parent6a09345e6cc8002dcb2da52da273c949107b9de3 (diff)
downloadgsoc2013-empathy-386ee2dc8453117ff1a2042ff0428a34d646b952.tar
gsoc2013-empathy-386ee2dc8453117ff1a2042ff0428a34d646b952.tar.gz
gsoc2013-empathy-386ee2dc8453117ff1a2042ff0428a34d646b952.tar.bz2
gsoc2013-empathy-386ee2dc8453117ff1a2042ff0428a34d646b952.tar.lz
gsoc2013-empathy-386ee2dc8453117ff1a2042ff0428a34d646b952.tar.xz
gsoc2013-empathy-386ee2dc8453117ff1a2042ff0428a34d646b952.tar.zst
gsoc2013-empathy-386ee2dc8453117ff1a2042ff0428a34d646b952.zip
accounts_dialog_accounts_setup: use empathy_connection_managers_prepare_async
That way we are sure that the callback is called even if the managers is already ready (#607925).
Diffstat (limited to 'src')
-rw-r--r--src/empathy-accounts-dialog.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c
index a64363ea6..190cc968c 100644
--- a/src/empathy-accounts-dialog.c
+++ b/src/empathy-accounts-dialog.c
@@ -1724,23 +1724,24 @@ accounts_dialog_set_selected_account (EmpathyAccountsDialog *dialog,
}
static void
-accounts_dialog_cms_ready_cb (EmpathyConnectionManagers *cms,
- GParamSpec *pspec,
- EmpathyAccountsDialog *dialog)
+accounts_dialog_cms_prepare_cb (GObject *source,
+ GAsyncResult *result,
+ gpointer user_data)
{
+ EmpathyConnectionManagers *cms = EMPATHY_CONNECTION_MANAGERS (source);
+ EmpathyAccountsDialog *dialog = user_data;
EmpathyAccountsDialogPriv *priv = GET_PRIV (dialog);
- if (empathy_connection_managers_is_ready (cms))
- {
- accounts_dialog_update_settings (dialog, NULL);
+ if (!empathy_connection_managers_prepare_finish (cms, result, NULL))
+ return;
- if (priv->initial_selection != NULL)
- {
- accounts_dialog_set_selected_account
- (dialog, priv->initial_selection);
- g_object_unref (priv->initial_selection);
- priv->initial_selection = NULL;
- }
+ accounts_dialog_update_settings (dialog, NULL);
+
+ if (priv->initial_selection != NULL)
+ {
+ accounts_dialog_set_selected_account (dialog, priv->initial_selection);
+ g_object_unref (priv->initial_selection);
+ priv->initial_selection = NULL;
}
}
@@ -1777,9 +1778,9 @@ accounts_dialog_accounts_setup (EmpathyAccountsDialog *dialog)
g_list_free (accounts);
priv->cms = empathy_connection_managers_dup_singleton ();
- if (!empathy_connection_managers_is_ready (priv->cms))
- g_signal_connect (priv->cms, "notify::ready",
- G_CALLBACK (accounts_dialog_cms_ready_cb), dialog);
+
+ empathy_connection_managers_prepare_async (priv->cms,
+ accounts_dialog_cms_prepare_cb, dialog);
accounts_dialog_model_select_first (dialog);
}