summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2012-06-28 16:43:25 +0100
committerJonny Lamb <jonny.lamb@collabora.co.uk>2012-08-03 10:44:54 +0100
commit6c1c9f1931e33682bfeba1241af5668b16772e91 (patch)
treebc5ff99628e648fc433de88531398da49a49eba9
parent528917d6e29367db41303adeffc98f694c794da6 (diff)
keyfile storage: store everything as strings, not values
Is this going to break everything? I hope not. Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
-rw-r--r--src/mcd-account-manager-default.c22
-rw-r--r--tests/twisted/mcp-account-diversion.c6
2 files changed, 14 insertions, 14 deletions
diff --git a/src/mcd-account-manager-default.c b/src/mcd-account-manager-default.c
index 4c474c50..d27fe05b 100644
--- a/src/mcd-account-manager-default.c
+++ b/src/mcd-account-manager-default.c
@@ -82,7 +82,7 @@ _delete_from_keyring (const McpAccountStorage *self,
else
{
/* remember to forget this one param */
- g_key_file_set_value (amd->removed, account, key, "");
+ g_key_file_set_string (amd->removed, account, key, "");
}
}
@@ -130,7 +130,7 @@ _keyring_commit_one (const McdAccountManagerDefault *amd,
{
gchar *name = g_strdup_printf ("account: %s; param: %s",
account_name, keys[j]);
- gchar *val = g_key_file_get_value (amd->secrets,
+ gchar *val = g_key_file_get_string (amd->secrets,
account_name, keys[j], NULL);
gchar *key = keys[j];
KeyringSetData *ksd = g_slice_new0 (KeyringSetData);
@@ -282,7 +282,7 @@ _get_secrets_from_keyring (const McpAccountStorage *self,
{
gchar *key = g_strdup_printf ("param-%s", param);
- g_key_file_set_value (amd->secrets, account, key, value);
+ g_key_file_set_string (amd->secrets, account, key, value);
mcp_account_manager_parameter_make_secret (am, account, key);
g_free (key);
@@ -414,9 +414,9 @@ _set (const McpAccountStorage *self,
if (val != NULL)
{
if (secret)
- g_key_file_set_value (amd->secrets, account, key, val);
+ g_key_file_set_string (amd->secrets, account, key, val);
else
- g_key_file_set_value (amd->keyfile, account, key, val);
+ g_key_file_set_string (amd->keyfile, account, key, val);
}
else
{
@@ -434,7 +434,7 @@ _set (const McpAccountStorage *self,
#else
if (val != NULL)
- g_key_file_set_value (amd->keyfile, account, key, val);
+ g_key_file_set_string (amd->keyfile, account, key, val);
else
g_key_file_remove_key (amd->keyfile, account, key, NULL);
@@ -457,13 +457,13 @@ _get (const McpAccountStorage *self,
#if ENABLE_GNOME_KEYRING
if (mcp_account_manager_parameter_is_secret (am, account, key))
- v = g_key_file_get_value (amd->secrets, account, key, NULL);
+ v = g_key_file_get_string (amd->secrets, account, key, NULL);
/* fall back to public source if secret was not in keyring */
if (v == NULL)
- v = g_key_file_get_value (amd->keyfile, account, key, NULL);
+ v = g_key_file_get_string (amd->keyfile, account, key, NULL);
#else
- v = g_key_file_get_value (amd->keyfile, account, key, NULL);
+ v = g_key_file_get_string (amd->keyfile, account, key, NULL);
#endif
if (v == NULL)
@@ -483,7 +483,7 @@ _get (const McpAccountStorage *self,
for (i = 0; i < n; i++)
{
- gchar *v = g_key_file_get_value (amd->keyfile, account, keys[i], NULL);
+ gchar *v = g_key_file_get_string (amd->keyfile, account, keys[i], NULL);
if (v != NULL)
mcp_account_manager_set_value (am, account, keys[i], v);
@@ -501,7 +501,7 @@ _get (const McpAccountStorage *self,
for (i = 0; i < n; i++)
{
- gchar *v = g_key_file_get_value (amd->secrets, account, keys[i], NULL);
+ gchar *v = g_key_file_get_string (amd->secrets, account, keys[i], NULL);
if (v != NULL)
{
diff --git a/tests/twisted/mcp-account-diversion.c b/tests/twisted/mcp-account-diversion.c
index 0994e25d..b47b8152 100644
--- a/tests/twisted/mcp-account-diversion.c
+++ b/tests/twisted/mcp-account-diversion.c
@@ -123,7 +123,7 @@ _set (const McpAccountStorage *self,
return FALSE;
adp->save = TRUE;
- g_key_file_set_value (adp->keyfile, account, key, val);
+ g_key_file_set_string (adp->keyfile, account, key, val);
return TRUE;
}
@@ -138,7 +138,7 @@ _get (const McpAccountStorage *self,
if (key != NULL)
{
- gchar *v = g_key_file_get_value (adp->keyfile, account, key, NULL);
+ gchar *v = g_key_file_get_string (adp->keyfile, account, key, NULL);
if (v == NULL)
return FALSE;
@@ -157,7 +157,7 @@ _get (const McpAccountStorage *self,
for (i = 0; i < n; i++)
{
- gchar *v = g_key_file_get_value (adp->keyfile, account, keys[i], NULL);
+ gchar *v = g_key_file_get_string (adp->keyfile, account, keys[i], NULL);
if (v != NULL)
mcp_account_manager_set_value (am, account, keys[i], v);