diff options
Diffstat (limited to 'ubuntu-online-accounts/cc-plugins/account-plugins/empathy-accounts-plugin-widget.c')
-rw-r--r-- | ubuntu-online-accounts/cc-plugins/account-plugins/empathy-accounts-plugin-widget.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/ubuntu-online-accounts/cc-plugins/account-plugins/empathy-accounts-plugin-widget.c b/ubuntu-online-accounts/cc-plugins/account-plugins/empathy-accounts-plugin-widget.c index 34729960c..28b4716ab 100644 --- a/ubuntu-online-accounts/cc-plugins/account-plugins/empathy-accounts-plugin-widget.c +++ b/ubuntu-online-accounts/cc-plugins/account-plugins/empathy-accounts-plugin-widget.c @@ -102,7 +102,7 @@ create_account_settings (AgAccount *account) AgService *service; GList *services; AgAccountService *account_service; - GValue v = G_VALUE_INIT; + GVariant *v; gchar *manager = NULL, *protocol = NULL; EmpathyAccountSettings *settings; @@ -114,17 +114,15 @@ create_account_settings (AgAccount *account) account_service = ag_account_service_new (account, service); - g_value_init (&v, G_TYPE_STRING); - if (ag_account_service_get_value (account_service, - "telepathy/manager", &v) != AG_SETTING_SOURCE_NONE) - manager = g_value_dup_string (&v); - g_value_unset (&v); - - g_value_init (&v, G_TYPE_STRING); - if (ag_account_service_get_value (account_service, - "telepathy/protocol", &v) != AG_SETTING_SOURCE_NONE) - protocol = g_value_dup_string (&v); - g_value_unset (&v); + v = ag_account_service_get_variant (account_service, + "telepathy/manager", NULL); + if (v != NULL) + manager = g_variant_dup_string (v, NULL); + + v = ag_account_service_get_variant (account_service, + "telepathy/protocol", NULL); + if (v != NULL) + protocol = g_variant_dup_string (v, NULL); g_return_val_if_fail (manager != NULL, NULL); g_return_val_if_fail (protocol != NULL, NULL); |