aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-03-30 19:44:13 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-03-30 20:00:39 +0800
commita787e76bd5803c0f5821c93cf5203c2c03d45001 (patch)
treec85aa26a8081d7cfd47f03c31a14841c08c3a7d2
parentd1576b8556b86b7eb0ade9c80e2747cfeb44f0c3 (diff)
downloadgsoc2013-empathy-a787e76bd5803c0f5821c93cf5203c2c03d45001.tar
gsoc2013-empathy-a787e76bd5803c0f5821c93cf5203c2c03d45001.tar.gz
gsoc2013-empathy-a787e76bd5803c0f5821c93cf5203c2c03d45001.tar.bz2
gsoc2013-empathy-a787e76bd5803c0f5821c93cf5203c2c03d45001.tar.lz
gsoc2013-empathy-a787e76bd5803c0f5821c93cf5203c2c03d45001.tar.xz
gsoc2013-empathy-a787e76bd5803c0f5821c93cf5203c2c03d45001.tar.zst
gsoc2013-empathy-a787e76bd5803c0f5821c93cf5203c2c03d45001.zip
accounts_dialog_enable_account_cb: use the usual async cb pattern
No semantic change. https://bugzilla.gnome.org/show_bug.cgi?id=673162
-rw-r--r--src/empathy-accounts-dialog.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c
index b776e1640..5a17df27c 100644
--- a/src/empathy-accounts-dialog.c
+++ b/src/empathy-accounts-dialog.c
@@ -220,26 +220,25 @@ accounts_dialog_status_infobar_set_message (EmpathyAccountsDialog *dialog,
}
static void
-accounts_dialog_enable_account_cb (GObject *account,
+accounts_dialog_enable_account_cb (GObject *object,
GAsyncResult *result,
gpointer user_data)
{
+ TpAccount *account = TP_ACCOUNT (object);
GError *error = NULL;
+ TpAccountManager *am;
- tp_account_set_enabled_finish (TP_ACCOUNT (account), result, &error);
-
- if (error != NULL)
+ if (!tp_account_set_enabled_finish (account, result, &error))
{
DEBUG ("Could not enable the account: %s", error->message);
g_error_free (error);
+ return;
}
- else
- {
- TpAccountManager *am = tp_account_manager_dup ();
- empathy_connect_new_account (TP_ACCOUNT (account), am);
- g_object_unref (am);
- }
+ am = tp_account_manager_dup ();
+
+ empathy_connect_new_account (account, am);
+ g_object_unref (am);
}
static void