[empathy] accounts-dialog: no need to connect the account if we are disabling it
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] accounts-dialog: no need to connect the account if we are disabling it
- Date: Fri, 30 Mar 2012 12:39:16 +0000 (UTC)
commit 02453f3777fb24c7f20ef4d839845c8c16e2e3c1
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Fri Mar 30 13:56:01 2012 +0200
accounts-dialog: no need to connect the account if we are disabling it
https://bugzilla.gnome.org/show_bug.cgi?id=673162
src/empathy-accounts-dialog.c | 18 +++++++++++++-----
1 files changed, 13 insertions(+), 5 deletions(-)
---
diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c
index 5a17df2..b0bb518 100644
--- a/src/empathy-accounts-dialog.c
+++ b/src/empathy-accounts-dialog.c
@@ -225,6 +225,7 @@ accounts_dialog_enable_account_cb (GObject *object,
gpointer user_data)
{
TpAccount *account = TP_ACCOUNT (object);
+ gboolean enable = GPOINTER_TO_UINT (user_data);
GError *error = NULL;
TpAccountManager *am;
@@ -235,10 +236,14 @@ accounts_dialog_enable_account_cb (GObject *object,
return;
}
- am = tp_account_manager_dup ();
+ /* tp_account_is_enabled() is not updated yet at this point */
+ if (enable)
+ {
+ am = tp_account_manager_dup ();
- empathy_connect_new_account (account, am);
- g_object_unref (am);
+ empathy_connect_new_account (account, am);
+ g_object_unref (am);
+ }
}
static void
@@ -248,6 +253,7 @@ accounts_dialog_enable_switch_active_cb (GtkSwitch *sw,
{
EmpathyAccountSettings *settings;
TpAccount *account;
+ gboolean enable;
settings = accounts_dialog_model_get_selected_settings (dialog);
if (settings == NULL)
@@ -257,8 +263,10 @@ accounts_dialog_enable_switch_active_cb (GtkSwitch *sw,
if (account == NULL)
return;
- tp_account_set_enabled_async (account, gtk_switch_get_active (sw),
- accounts_dialog_enable_account_cb, NULL);
+ enable = gtk_switch_get_active (sw);
+
+ tp_account_set_enabled_async (account, enable,
+ accounts_dialog_enable_account_cb, GUINT_TO_POINTER (enable));
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]