diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2009-11-13 22:31:34 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2009-11-13 22:31:34 +0800 |
commit | ef9f82c085a018e3959800ad010f47da62d9b364 (patch) | |
tree | 6fe4c910b6bcfcb26e1b3d4820261ac0ed1094ba | |
parent | 9355fec8db2944c7d32a0e0ba3e1632d8088c88e (diff) | |
download | gsoc2013-empathy-ef9f82c085a018e3959800ad010f47da62d9b364.tar gsoc2013-empathy-ef9f82c085a018e3959800ad010f47da62d9b364.tar.gz gsoc2013-empathy-ef9f82c085a018e3959800ad010f47da62d9b364.tar.bz2 gsoc2013-empathy-ef9f82c085a018e3959800ad010f47da62d9b364.tar.lz gsoc2013-empathy-ef9f82c085a018e3959800ad010f47da62d9b364.tar.xz gsoc2013-empathy-ef9f82c085a018e3959800ad010f47da62d9b364.tar.zst gsoc2013-empathy-ef9f82c085a018e3959800ad010f47da62d9b364.zip |
accounts-dialog: wait that account is prepared before calling accounts_dialog_add_account
This ensure that EmpathyAccountSettings has been updated and so we don't
add a new row in the model for this account (#601796).
-rw-r--r-- | src/empathy-accounts-dialog.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c index e4e963c9a..daae3d874 100644 --- a/src/empathy-accounts-dialog.c +++ b/src/empathy-accounts-dialog.c @@ -1237,12 +1237,31 @@ accounts_dialog_add_account (EmpathyAccountsDialog *dialog, } static void +account_prepare_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) +{ + EmpathyAccountsDialog *dialog = EMPATHY_ACCOUNTS_DIALOG (user_data); + TpAccount *account = TP_ACCOUNT (source_object); + GError *error = NULL; + + if (!tp_account_prepare_finish (account, result, &error)) + { + DEBUG ("Failed to prepare account: %s", error->message); + g_error_free (error); + return; + } + + accounts_dialog_add_account (dialog, account); +} + +static void accounts_dialog_account_validity_changed_cb (TpAccountManager *manager, TpAccount *account, gboolean valid, EmpathyAccountsDialog *dialog) { - accounts_dialog_add_account (dialog, account); + tp_account_prepare_async (account, NULL, account_prepare_cb, dialog); } static void |