summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVivek Dasmohapatra <vivek@collabora.co.uk>2010-10-12 15:35:10 +0100
committerVivek Dasmohapatra <vivek@collabora.co.uk>2010-10-12 15:43:44 +0100
commit3c1fefe21ebc9603bc0a0b4ff56cae9a369d59ef (patch)
tree2cb19932d903632a4ff24a6142f2933e3ab1979e
parent08e39a3aa4003b2a31c6a548610cf5fa32bf3b9d (diff)
downloadtelepathy-mission-control-3c1fefe21ebc9603bc0a0b4ff56cae9a369d59ef.tar.gz
Helper function to save settings in the SSO
-rw-r--r--test/account-store-libaccounts.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/account-store-libaccounts.c b/test/account-store-libaccounts.c
index 266d85a1..29026e3a 100644
--- a/test/account-store-libaccounts.c
+++ b/test/account-store-libaccounts.c
@@ -400,6 +400,40 @@ static void _sso_account_enable (AgAccount *account,
ag_account_select_service (account, original);
}
+/* saving settings other than the enabled tri-state */
+static void
+save_setting (AgAccount *account,
+ const Setting *setting,
+ const gchar *val)
+{
+ AgService *service = ag_account_get_selected_service (account);
+
+ if (!setting->writable)
+ return;
+
+ if (setting->global)
+ ag_account_select_service (account, NULL);
+ else if (service == NULL)
+ _ag_account_select_default_im_service (account);
+
+ if (val != NULL)
+ {
+ GValue value = { 0 };
+
+ g_value_init (&value, G_TYPE_STRING);
+ g_value_set_string (&value, val);
+ ag_account_set_value (account, setting->ag_name, &value);
+ g_value_unset (&value);
+ }
+ else
+ {
+ ag_account_set_value (account, setting->ag_name, NULL);
+ }
+
+ /* leave the selected service as we found it: */
+ ag_account_select_service (account, service);
+}
+
gchar *
libaccounts_get (const gchar *mc_account,
const gchar *key)