aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
Diffstat (limited to 'e-util')
-rw-r--r--e-util/ChangeLog7
-rw-r--r--e-util/e-config-listener.c11
2 files changed, 18 insertions, 0 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog
index 6b7fa1d3ec..d70eb132f9 100644
--- a/e-util/ChangeLog
+++ b/e-util/ChangeLog
@@ -1,3 +1,10 @@
+2002-08-26 Rodrigo Moya <rodrigo@ximian.com>
+
+ * e-config-listener.c (e_config_listener_set_long): only set the key
+ if the value is different from what we've already read from the
+ database, to avoid extra change notifications.
+ (e_config_listener_set_string): likewise.
+
2002-08-22 Rodrigo Moya <rodrigo@ximian.com>
* e-config-listener.[ch]: added "key_changed" signal to class.
diff --git a/e-util/e-config-listener.c b/e-util/e-config-listener.c
index df3dfdf27c..88debbd8b0 100644
--- a/e-util/e-config-listener.c
+++ b/e-util/e-config-listener.c
@@ -382,6 +382,10 @@ e_config_listener_set_long (EConfigListener *cl, const char *key, long value)
g_return_if_fail (E_IS_CONFIG_LISTENER (cl));
g_return_if_fail (key != NULL);
+ /* check that the value is not the same */
+ if (value == e_config_listener_get_long_with_default (cl, key, 0, NULL))
+ return;
+
CORBA_exception_init (&ev);
bonobo_config_set_long (cl->priv->db, key, value, &ev);
@@ -395,10 +399,17 @@ void
e_config_listener_set_string (EConfigListener *cl, const char *key, const char *value)
{
CORBA_Environment ev;
+ char *s1, *s2;
g_return_if_fail (E_IS_CONFIG_LISTENER (cl));
g_return_if_fail (key != NULL);
+ /* check that the value is not the same */
+ s1 = value;
+ s2 = e_config_listener_get_string_with_default (cl, key, NULL, NULL);
+ if (!strcmp (s1 ? s1 : "", s2 ? s2 : ""))
+ return;
+
CORBA_exception_init (&ev);
bonobo_config_set_string (cl->priv->db, key, value, &ev);