aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-account-settings.c
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2009-08-05 00:21:47 +0800
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-08-22 21:20:43 +0800
commitfa77756bd1db1c0b657fc784508890330bd5bfb3 (patch)
tree56f1fa893192111cd738866a521758712c92b921 /libempathy/empathy-account-settings.c
parentc037c417937a5a77a8c8bc168103cb3c5a19a659 (diff)
downloadgsoc2013-empathy-fa77756bd1db1c0b657fc784508890330bd5bfb3.tar
gsoc2013-empathy-fa77756bd1db1c0b657fc784508890330bd5bfb3.tar.gz
gsoc2013-empathy-fa77756bd1db1c0b657fc784508890330bd5bfb3.tar.bz2
gsoc2013-empathy-fa77756bd1db1c0b657fc784508890330bd5bfb3.tar.lz
gsoc2013-empathy-fa77756bd1db1c0b657fc784508890330bd5bfb3.tar.xz
gsoc2013-empathy-fa77756bd1db1c0b657fc784508890330bd5bfb3.tar.zst
gsoc2013-empathy-fa77756bd1db1c0b657fc784508890330bd5bfb3.zip
Remove the parameters from the unset pool when we set them again
Diffstat (limited to 'libempathy/empathy-account-settings.c')
-rw-r--r--libempathy/empathy-account-settings.c36
1 files changed, 35 insertions, 1 deletions
diff --git a/libempathy/empathy-account-settings.c b/libempathy/empathy-account-settings.c
index 5c4644d5a..ad7874d6c 100644
--- a/libempathy/empathy-account-settings.c
+++ b/libempathy/empathy-account-settings.c
@@ -515,6 +515,29 @@ empathy_account_settings_get_tp_param (EmpathyAccountSettings *settings,
return NULL;
}
+static void
+account_settings_remove_from_unset (EmpathyAccountSettings *settings,
+ const gchar *param)
+{
+ EmpathyAccountSettingsPriv *priv = GET_PRIV (settings);
+ int idx;
+ gchar *val;
+
+ for (idx = 0; idx < priv->unset_parameters->len; idx++)
+ {
+ val = g_array_index (priv->unset_parameters, gchar *, idx);
+
+ if (!tp_strdiff (val, param))
+ {
+ priv->unset_parameters =
+ g_array_remove_index (priv->unset_parameters, idx);
+ g_free (val);
+
+ break;
+ }
+ }
+}
+
const GValue *
empathy_account_settings_get_default (EmpathyAccountSettings *settings,
const gchar *param)
@@ -572,7 +595,6 @@ empathy_account_settings_get (EmpathyAccountSettings *settings,
return empathy_account_settings_get_default (settings, param);
}
-
void
empathy_account_settings_unset (EmpathyAccountSettings *settings,
const gchar *param)
@@ -768,6 +790,8 @@ empathy_account_settings_set_string (EmpathyAccountSettings *settings,
EmpathyAccountSettingsPriv *priv = GET_PRIV (settings);
tp_asv_set_string (priv->parameters, g_strdup (param), value);
+
+ account_settings_remove_from_unset (settings, param);
}
void
@@ -778,6 +802,8 @@ empathy_account_settings_set_int32 (EmpathyAccountSettings *settings,
EmpathyAccountSettingsPriv *priv = GET_PRIV (settings);
tp_asv_set_int32 (priv->parameters, g_strdup (param), value);
+
+ account_settings_remove_from_unset (settings, param);
}
void
@@ -788,6 +814,8 @@ empathy_account_settings_set_int64 (EmpathyAccountSettings *settings,
EmpathyAccountSettingsPriv *priv = GET_PRIV (settings);
tp_asv_set_int64 (priv->parameters, g_strdup (param), value);
+
+ account_settings_remove_from_unset (settings, param);
}
void
@@ -798,6 +826,8 @@ empathy_account_settings_set_uint32 (EmpathyAccountSettings *settings,
EmpathyAccountSettingsPriv *priv = GET_PRIV (settings);
tp_asv_set_uint32 (priv->parameters, g_strdup (param), value);
+
+ account_settings_remove_from_unset (settings, param);
}
void
@@ -808,6 +838,8 @@ empathy_account_settings_set_uint64 (EmpathyAccountSettings *settings,
EmpathyAccountSettingsPriv *priv = GET_PRIV (settings);
tp_asv_set_uint64 (priv->parameters, g_strdup (param), value);
+
+ account_settings_remove_from_unset (settings, param);
}
void
@@ -818,6 +850,8 @@ empathy_account_settings_set_boolean (EmpathyAccountSettings *settings,
EmpathyAccountSettingsPriv *priv = GET_PRIV (settings);
tp_asv_set_boolean (priv->parameters, g_strdup (param), value);
+
+ account_settings_remove_from_unset (settings, param);
}
static void