aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@ximian.com>2002-09-05 19:23:42 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2002-09-05 19:23:42 +0800
commit9c2d49aa469eb1cbd89bb4b4021add3a8e34d3e2 (patch)
tree4312f44aa46c01e37c78cb8f445d1e9bb595c6f7 /e-util
parent77a9892f1b8746019c38fa3d501e89402948fbbe (diff)
downloadgsoc2013-evolution-9c2d49aa469eb1cbd89bb4b4021add3a8e34d3e2.tar.gz
gsoc2013-evolution-9c2d49aa469eb1cbd89bb4b4021add3a8e34d3e2.tar.zst
gsoc2013-evolution-9c2d49aa469eb1cbd89bb4b4021add3a8e34d3e2.zip
update the local copy (if we've got one) so that we don't return values if
2002-09-05 Rodrigo Moya <rodrigo@ximian.com> * e-config-listener.c (e_config_listener_set_boolean, e_config_listener_set_float, e_config_listener_set_long, e_config_listener_set_string): update the local copy (if we've got one) so that we don't return values if asked before getting the change notification. svn path=/trunk/; revision=17985
Diffstat (limited to 'e-util')
-rw-r--r--e-util/ChangeLog8
-rw-r--r--e-util/e-config-listener.c26
2 files changed, 34 insertions, 0 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog
index c58ab2ef73..c86e5c9c59 100644
--- a/e-util/ChangeLog
+++ b/e-util/ChangeLog
@@ -1,3 +1,11 @@
+2002-09-05 Rodrigo Moya <rodrigo@ximian.com>
+
+ * e-config-listener.c (e_config_listener_set_boolean,
+ e_config_listener_set_float, e_config_listener_set_long,
+ e_config_listener_set_string): update the local copy (if we've
+ got one) so that we don't return values if asked before getting
+ the change notification.
+
2002-09-04 Dan Winship <danw@ximian.com>
* e-time-utils.c (e_mktime_utc): New. Like mktime(3), but assumes
diff --git a/e-util/e-config-listener.c b/e-util/e-config-listener.c
index 1d4f38ce87..1a2c48520f 100644
--- a/e-util/e-config-listener.c
+++ b/e-util/e-config-listener.c
@@ -422,6 +422,7 @@ void
e_config_listener_set_boolean (EConfigListener *cl, const char *key, gboolean value)
{
CORBA_Environment ev;
+ KeyData *kd;
g_return_if_fail (E_IS_CONFIG_LISTENER (cl));
g_return_if_fail (key != NULL);
@@ -437,12 +438,18 @@ e_config_listener_set_boolean (EConfigListener *cl, const char *key, gboolean va
g_warning ("Cannot save config key %s -- %s", key, BONOBO_EX_ID (&ev));
CORBA_exception_free (&ev);
+
+ /* update the internal copy */
+ kd = g_hash_table_lookup (cl->priv->keys, key);
+ if (kd)
+ kd->value.v_bool = value;
}
void
e_config_listener_set_float (EConfigListener *cl, const char *key, float value)
{
CORBA_Environment ev;
+ KeyData *kd;
g_return_if_fail (E_IS_CONFIG_LISTENER (cl));
g_return_if_fail (key != NULL);
@@ -458,12 +465,18 @@ e_config_listener_set_float (EConfigListener *cl, const char *key, float value)
g_warning ("Cannot save config key %s -- %s", key, BONOBO_EX_ID (&ev));
CORBA_exception_free (&ev);
+
+ /* update the internal copy */
+ kd = g_hash_table_lookup (cl->priv->keys, key);
+ if (kd)
+ kd->value.v_float = value;
}
void
e_config_listener_set_long (EConfigListener *cl, const char *key, long value)
{
CORBA_Environment ev;
+ KeyData *kd;
g_return_if_fail (E_IS_CONFIG_LISTENER (cl));
g_return_if_fail (key != NULL);
@@ -479,6 +492,11 @@ e_config_listener_set_long (EConfigListener *cl, const char *key, long value)
g_warning ("Cannot save config key %s -- %s", key, BONOBO_EX_ID (&ev));
CORBA_exception_free (&ev);
+
+ /* update the internal copy */
+ kd = g_hash_table_lookup (cl->priv->keys, key);
+ if (kd)
+ kd->value.v_long = value;
}
void
@@ -486,6 +504,7 @@ e_config_listener_set_string (EConfigListener *cl, const char *key, const char *
{
CORBA_Environment ev;
char *s1, *s2;
+ KeyData *kd;
g_return_if_fail (E_IS_CONFIG_LISTENER (cl));
g_return_if_fail (key != NULL);
@@ -507,6 +526,13 @@ e_config_listener_set_string (EConfigListener *cl, const char *key, const char *
g_warning ("Cannot save config key %s -- %s", key, BONOBO_EX_ID (&ev));
CORBA_exception_free (&ev);
+
+ /* update the internal copy */
+ kd = g_hash_table_lookup (cl->priv->keys, key);
+ if (kd) {
+ g_free (kd->value.v_str);
+ kd->value.v_str = g_strdup (value);
+ }
}
Bonobo_ConfigDatabase