aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-accounts-dialog.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-03-30 19:56:01 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-03-30 20:00:39 +0800
commit02453f3777fb24c7f20ef4d839845c8c16e2e3c1 (patch)
treebe883fc30c7036188608734919ebc9f37423eb32 /src/empathy-accounts-dialog.c
parenta787e76bd5803c0f5821c93cf5203c2c03d45001 (diff)
downloadgsoc2013-empathy-02453f3777fb24c7f20ef4d839845c8c16e2e3c1.tar
gsoc2013-empathy-02453f3777fb24c7f20ef4d839845c8c16e2e3c1.tar.gz
gsoc2013-empathy-02453f3777fb24c7f20ef4d839845c8c16e2e3c1.tar.bz2
gsoc2013-empathy-02453f3777fb24c7f20ef4d839845c8c16e2e3c1.tar.lz
gsoc2013-empathy-02453f3777fb24c7f20ef4d839845c8c16e2e3c1.tar.xz
gsoc2013-empathy-02453f3777fb24c7f20ef4d839845c8c16e2e3c1.tar.zst
gsoc2013-empathy-02453f3777fb24c7f20ef4d839845c8c16e2e3c1.zip
accounts-dialog: no need to connect the account if we are disabling it
https://bugzilla.gnome.org/show_bug.cgi?id=673162
Diffstat (limited to 'src/empathy-accounts-dialog.c')
-rw-r--r--src/empathy-accounts-dialog.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c
index 5a17df27c..b0bb51822 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