Fix bug that prevented a reasonable default from being fetched. Use the

provided default value if the stored one is null.
This commit is contained in:
Ramiro Estrugo 2000-04-18 21:02:44 +00:00
parent 9f1eccb99b
commit fbd277e07a
4 changed files with 24 additions and 15 deletions

View file

@ -1,3 +1,9 @@
2000-04-18 Ramiro Estrugo <ramiro@eazel.com>
* nautilus-widgets/nautilus-preferences.c:
(preference_get): If the stored default_value is NULL, then used
the provided one.
2000-04-19 Andy Hertzfeld <andy@eazel.com>
added better abstraction for the xml-based links introduced yesterday

View file

@ -506,10 +506,10 @@ preference_set (NautilusPreferences *preferences,
static void
preference_get (const NautilusPreferences *preferences,
const char *name,
NautilusPreferenceType type,
gconstpointer default_value,
gconstpointer *value_out)
const char *name,
NautilusPreferenceType type,
gconstpointer default_value,
gconstpointer *value_out)
{
PrefHashNode *pref_hash_node;
@ -525,7 +525,8 @@ preference_get (const NautilusPreferences *preferences,
g_assert (pref_hash_node != NULL);
*value_out = pref_hash_node->value;
/* If the stored default_value is NULL, then used the provided one */
*value_out = (pref_hash_node->value ? pref_hash_node->value : default_value);
}
/*

View file

@ -506,10 +506,10 @@ preference_set (NautilusPreferences *preferences,
static void
preference_get (const NautilusPreferences *preferences,
const char *name,
NautilusPreferenceType type,
gconstpointer default_value,
gconstpointer *value_out)
const char *name,
NautilusPreferenceType type,
gconstpointer default_value,
gconstpointer *value_out)
{
PrefHashNode *pref_hash_node;
@ -525,7 +525,8 @@ preference_get (const NautilusPreferences *preferences,
g_assert (pref_hash_node != NULL);
*value_out = pref_hash_node->value;
/* If the stored default_value is NULL, then used the provided one */
*value_out = (pref_hash_node->value ? pref_hash_node->value : default_value);
}
/*

View file

@ -506,10 +506,10 @@ preference_set (NautilusPreferences *preferences,
static void
preference_get (const NautilusPreferences *preferences,
const char *name,
NautilusPreferenceType type,
gconstpointer default_value,
gconstpointer *value_out)
const char *name,
NautilusPreferenceType type,
gconstpointer default_value,
gconstpointer *value_out)
{
PrefHashNode *pref_hash_node;
@ -525,7 +525,8 @@ preference_get (const NautilusPreferences *preferences,
g_assert (pref_hash_node != NULL);
*value_out = pref_hash_node->value;
/* If the stored default_value is NULL, then used the provided one */
*value_out = (pref_hash_node->value ? pref_hash_node->value : default_value);
}
/*