diff options
author | Ramiro Estrugo <ramiro@src.gnome.org> | 2000-05-29 00:40:44 +0000 |
---|---|---|
committer | Ramiro Estrugo <ramiro@src.gnome.org> | 2000-05-29 00:40:44 +0000 |
commit | 69748988fd47bd7990da6b9be745ab2ecb6d8ea0 (patch) | |
tree | b88b857ff65cfec39c1f943d55fac036af824175 /libnautilus-extensions/nautilus-preferences.c | |
parent | b8672a4eb63e9fc57836b5892baedae5fc5447fe (diff) | |
download | nautilus-69748988fd47bd7990da6b9be745ab2ecb6d8ea0.tar.gz |
Make sure the preference values are indeed different than the
currently stored ones. Otherwise, bogus callbacks get emitted
causing innefecient (and unneeded!) things such as directories
reloading.
Diffstat (limited to 'libnautilus-extensions/nautilus-preferences.c')
-rw-r--r-- | libnautilus-extensions/nautilus-preferences.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/libnautilus-extensions/nautilus-preferences.c b/libnautilus-extensions/nautilus-preferences.c index 6ab569bd6..45b640fb6 100644 --- a/libnautilus-extensions/nautilus-preferences.c +++ b/libnautilus-extensions/nautilus-preferences.c @@ -29,6 +29,7 @@ #include <libnautilus-extensions/nautilus-gtk-macros.h> #include <libnautilus-extensions/nautilus-glib-extensions.h> +#include <libnautilus-extensions/nautilus-string.h> #include <gconf/gconf.h> #include <gconf/gconf-client.h> @@ -805,6 +806,11 @@ nautilus_preferences_set_boolean (const char *name, g_return_if_fail (nautilus_preferences_is_initialized ()); g_return_if_fail (name != NULL); + /* Make sure the preference value is indeed different */ + if (gconf_client_get_bool (preference_gconf_client, name, NULL) == boolean_value) { + return; + } + gconf_result = gconf_client_set_bool (preference_gconf_client, name, boolean_value, @@ -834,6 +840,11 @@ nautilus_preferences_set_enum (const char *name, g_return_if_fail (nautilus_preferences_is_initialized ()); g_return_if_fail (name != NULL); + /* Make sure the preference value is indeed different */ + if (gconf_client_get_int (preference_gconf_client, name, NULL) == enum_value) { + return; + } + gconf_result = gconf_client_set_int (preference_gconf_client, name, enum_value, @@ -863,6 +874,20 @@ nautilus_preferences_set (const char *name, g_return_if_fail (nautilus_preferences_is_initialized ()); g_return_if_fail (name != NULL); + /* Make sure the preference value is indeed different */ + if (value) { + char *current_value = gconf_client_get_string (preference_gconf_client, name, NULL); + int result = nautilus_strcmp (current_value, value); + + if (current_value) { + g_free (current_value); + } + + if (result == 0) { + return; + } + } + gconf_result = gconf_client_set_string (preference_gconf_client, name, value, |