diff options
author | Jonny Lamb <jonnylamb@gnome.org> | 2010-12-10 20:02:17 +0800 |
---|---|---|
committer | Jonny Lamb <jonnylamb@gnome.org> | 2011-01-26 21:36:40 +0800 |
commit | 09dfb1223c619498c4ef29567d34ba43b8c455b9 (patch) | |
tree | 5688f83a3720cf96d3e5f0cf2293d822b113851a /libempathy | |
parent | 41433901d4d8aa182895a71c868c38dc16173573 (diff) | |
download | gsoc2013-empathy-09dfb1223c619498c4ef29567d34ba43b8c455b9.tar gsoc2013-empathy-09dfb1223c619498c4ef29567d34ba43b8c455b9.tar.gz gsoc2013-empathy-09dfb1223c619498c4ef29567d34ba43b8c455b9.tar.bz2 gsoc2013-empathy-09dfb1223c619498c4ef29567d34ba43b8c455b9.tar.lz gsoc2013-empathy-09dfb1223c619498c4ef29567d34ba43b8c455b9.tar.xz gsoc2013-empathy-09dfb1223c619498c4ef29567d34ba43b8c455b9.tar.zst gsoc2013-empathy-09dfb1223c619498c4ef29567d34ba43b8c455b9.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.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/libempathy/empathy-account-settings.c b/libempathy/empathy-account-settings.c index 8a92dfd96..d7a202eed 100644 --- a/libempathy/empathy-account-settings.c +++ b/libempathy/empathy-account-settings.c @@ -49,6 +49,13 @@ enum { PROP_READY }; +enum { + PASSWORD_RETRIEVED = 1, + LAST_SIGNAL +}; + +static gulong signals[LAST_SIGNAL] = { 0, }; + /* private structure */ typedef struct _EmpathyAccountSettingsPriv EmpathyAccountSettingsPriv; @@ -291,6 +298,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 @@ -417,9 +431,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 @@ -514,14 +526,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; |