diff options
-rw-r--r-- | src/mcd-account-manager.c | 4 | ||||
-rw-r--r-- | src/mcd-account.c | 18 | ||||
-rw-r--r-- | src/mcd-account.h | 6 |
3 files changed, 24 insertions, 4 deletions
diff --git a/src/mcd-account-manager.c b/src/mcd-account-manager.c index 4d93220b..a13ba032 100644 --- a/src/mcd-account-manager.c +++ b/src/mcd-account-manager.c @@ -1222,7 +1222,9 @@ migrate_butterfly_haze_ready (McdManager *manager, } /* Parameters; we just care about 'account' */ - if (!mcd_account_get_parameter (ctx->account, "account", &v, NULL)) + if (!mcd_account_get_parameter_of_known_type (ctx->account, + "account", G_TYPE_STRING, + &v, NULL)) { _mcd_account_set_enabled (ctx->account, FALSE, TRUE, NULL); goto error; diff --git a/src/mcd-account.c b/src/mcd-account.c index 192d8d95..1864e7db 100644 --- a/src/mcd-account.c +++ b/src/mcd-account.c @@ -429,16 +429,28 @@ mcd_account_get_parameter (McdAccount *account, const gchar *name, GError **error) { McdAccountPrivate *priv = account->priv; - McdStorage *storage = priv->storage; - gchar key[MAX_KEY_LENGTH]; const TpConnectionManagerParam *param; GType type; - const gchar *account_name = mcd_account_get_unique_name (account); param = mcd_manager_get_protocol_param (priv->manager, priv->protocol_name, name); type = mc_param_type (param); + return mcd_account_get_parameter_of_known_type (account, name, + type, parameter, error); +} + +gboolean +mcd_account_get_parameter_of_known_type (McdAccount *account, + const gchar *name, + GType type, + GValue *parameter, + GError **error) +{ + const gchar *account_name = mcd_account_get_unique_name (account); + McdStorage *storage = account->priv->storage; + gchar key[MAX_KEY_LENGTH]; + g_snprintf (key, sizeof (key), "param-%s", name); if (mcd_storage_has_value (storage, account_name, key)) diff --git a/src/mcd-account.h b/src/mcd-account.h index 6b0dd605..90e429af 100644 --- a/src/mcd-account.h +++ b/src/mcd-account.h @@ -148,6 +148,12 @@ gboolean mcd_account_get_parameter (McdAccount *account, const gchar *name, GValue *parameter, GError **error); +gboolean mcd_account_get_parameter_of_known_type (McdAccount *account, + const gchar *name, + GType type, + GValue *parameter, + GError **error); + gchar * mcd_account_dup_icon (McdAccount *self); gchar * mcd_account_dup_nickname (McdAccount *self); |