summaryrefslogtreecommitdiff
path: root/libnautilus-private/nautilus-preferences.c
diff options
context:
space:
mode:
authorRamiro Estrugo <ramiro@src.gnome.org>2000-04-19 02:48:42 +0000
committerRamiro Estrugo <ramiro@src.gnome.org>2000-04-19 02:48:42 +0000
commitefe511715719298649f6aa5fdb2b630158e48500 (patch)
treeb6286f157308ec3dc8ad3fd36b0a9835b45f908d /libnautilus-private/nautilus-preferences.c
parent470022d345edbcdba532b0ba1eb2a8792170be46 (diff)
downloadnautilus-efe511715719298649f6aa5fdb2b630158e48500.tar.gz
If the stored default value is null, is the given on. Do this only for
* nautilus-widgets/nautilus-preferences.c: (nautilus_preferences_get): If the stored default value is null, is the given on. Do this only for strings, since integral types can legally have a value of zero. * nautilus-widgets/nautilus-preferences-item.c: (preferences_item_create_enum), (enum_radio_group_changed_cb): Deal with the enumeration values. Before it was assuming it started at ZERO. * libnautilus-extensions/nautilus-global-preferences.c: NAUTILUS_USER_LEVEL_*: Make this enum begin with a non zero value. The zero value can be misintepreted by preferences as a default leading to confusion. (user_level_changed_callback): Add a default case just in case! (nautilus_global_preferences_startup): Invoke user_level_changed_callback once to make sure stuff is properly setup.
Diffstat (limited to 'libnautilus-private/nautilus-preferences.c')
-rw-r--r--libnautilus-private/nautilus-preferences.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libnautilus-private/nautilus-preferences.c b/libnautilus-private/nautilus-preferences.c
index c18cb79e8..9054c54a2 100644
--- a/libnautilus-private/nautilus-preferences.c
+++ b/libnautilus-private/nautilus-preferences.c
@@ -525,8 +525,7 @@ preference_get (const NautilusPreferences *preferences,
g_assert (pref_hash_node != NULL);
- /* If the stored default_value is NULL, then used the provided one */
- *value_out = (pref_hash_node->value ? pref_hash_node->value : default_value);
+ *value_out = pref_hash_node->value;
}
/*
@@ -987,6 +986,10 @@ nautilus_preferences_get (const NautilusPreferences *preferences,
(gconstpointer) default_value,
&value);
+ /* If the stored default_value is NULL, then used the provided one */
+ if (!value)
+ value = default_value;
+
return g_strdup (value);
}