aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorJonny Lamb <jonnylamb@gnome.org>2010-12-10 20:02:17 +0800
committerJonny Lamb <jonnylamb@gnome.org>2010-12-10 20:02:17 +0800
commite52ae339c601c4173b011ad28bcdca816649fd4c (patch)
treeccda71d347be3ca1b546d81076c7cd46c74b6cd5 /libempathy
parent41dd635842b27268454435c557b74ea32245c7ae (diff)
downloadgsoc2013-empathy-e52ae339c601c4173b011ad28bcdca816649fd4c.tar
gsoc2013-empathy-e52ae339c601c4173b011ad28bcdca816649fd4c.tar.gz
gsoc2013-empathy-e52ae339c601c4173b011ad28bcdca816649fd4c.tar.bz2
gsoc2013-empathy-e52ae339c601c4173b011ad28bcdca816649fd4c.tar.lz
gsoc2013-empathy-e52ae339c601c4173b011ad28bcdca816649fd4c.tar.xz
gsoc2013-empathy-e52ae339c601c4173b011ad28bcdca816649fd4c.tar.zst
gsoc2013-empathy-e52ae339c601c4173b011ad28bcdca816649fd4c.zip
account-settings: don't block notify::ready on getting a password
The account widget acts a little more synchronously, so we can't wait for the keyring to give us the password. We can signal later about it though. Signed-off-by: Jonny Lamb <jonnylamb@gnome.org>
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-account-settings.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/libempathy/empathy-account-settings.c b/libempathy/empathy-account-settings.c
index e0a24b4d6..75538e26e 100644
--- a/libempathy/empathy-account-settings.c
+++ b/libempathy/empathy-account-settings.c
@@ -50,6 +50,13 @@ enum {
PROP_READY
};
+enum {
+ PASSWORD_RETRIEVED = 1,
+ LAST_SIGNAL
+};
+
+static gulong signals[LAST_SIGNAL] = { 0, };
+
/* private structure */
typedef struct _EmpathyAccountSettingsPriv EmpathyAccountSettingsPriv;
@@ -319,6 +326,13 @@ empathy_account_settings_class_init (
"Whether this account is ready to be used",
FALSE,
G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
+
+ signals[PASSWORD_RETRIEVED] =
+ g_signal_new ("password-retrieved",
+ G_TYPE_FROM_CLASS (empathy_account_settings_class),
+ G_SIGNAL_RUN_LAST, 0, NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
}
static void
@@ -452,9 +466,7 @@ empathy_account_settings_get_password_cb (GObject *source,
priv->password = g_strdup (password);
priv->password_original = g_strdup (password);
- priv->password_retrieved = TRUE;
-
- empathy_account_settings_check_readyness (self);
+ g_signal_emit (self, signals[PASSWORD_RETRIEVED], 0);
}
static void
@@ -546,14 +558,15 @@ empathy_account_settings_check_readyness (EmpathyAccountSettings *self)
/* priv->account won't be a proper account if it's the account
* assistant showing this widget. */
- if (priv->supports_sasl && !priv->password_retrieved
- && !priv->password_requested && priv->account != NULL)
+ if (priv->supports_sasl && !priv->password_requested
+ && priv->account != NULL)
{
priv->password_requested = TRUE;
+ /* Make this call but don't block on its readiness. We'll signal
+ * if it's updated later with ::password-retrieved. */
empathy_keyring_get_password_async (priv->account,
empathy_account_settings_get_password_cb, self);
- return;
}
priv->ready = TRUE;