diff options
author | Ramiro Estrugo <ramiro@src.gnome.org> | 2000-03-12 19:46:01 +0000 |
---|---|---|
committer | Ramiro Estrugo <ramiro@src.gnome.org> | 2000-03-12 19:46:01 +0000 |
commit | eb3615ad90f0e5c82bddac6a2899cc950bb6064b (patch) | |
tree | 1ce4152d3e9fbc4b242ba83568d485c590f0023b /libnautilus-extensions/nautilus-preferences-item.c | |
parent | 588590133791d9ad33b86e0be1f23f33bae2ba95 (diff) | |
download | nautilus-eb3615ad90f0e5c82bddac6a2899cc950bb6064b.tar.gz |
Make the preference changes persistent.
* nautilus-widgets/nautilus-preferences.c:
(prefs_set_pref, nautilus_preferences_register_from_info,
nautilus_preferences_register_from_values): Make the preference
changes persistent.
*nautilus-widgets/nautilus-preferences-item.c,
nautilus-widgets/nautilus-preferences-item.h,
nautilus-widgets/nautilus-preferences.c,
nautilus-widgets/nautilus-preferences.h,
nautilus-widgets/test-nautilus-widgets.c:
Dont use GtkFunadamentalType, since we obviously wont support
all fundamantal gtk types as preferences. Use an enum instead.
Makes the preferences type whacking code exactly 14.85% more type
safe.
Diffstat (limited to 'libnautilus-extensions/nautilus-preferences-item.c')
-rw-r--r-- | libnautilus-extensions/nautilus-preferences-item.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/libnautilus-extensions/nautilus-preferences-item.c b/libnautilus-extensions/nautilus-preferences-item.c index 2841fdd9d..a0466d391 100644 --- a/libnautilus-extensions/nautilus-preferences-item.c +++ b/libnautilus-extensions/nautilus-preferences-item.c @@ -50,7 +50,7 @@ static const guint PREFERENCES_ITEM_FRAME_BORDER_WIDTH = 6; struct _NautilusPreferencesItemDetails { gchar *pref_name; - NautilusPreferencesItemType item_type; + NautilusPreferencesType item_type; GtkWidget *child; GtkObject *prefs; }; @@ -74,7 +74,7 @@ static void preferences_item_get_arg (GtkObject static void preferences_item_construct (NautilusPreferencesItem *item, GtkObject *prefs, const gchar *pref_name, - NautilusPreferencesItemType item_type); + NautilusPreferencesType item_type); static void preferences_item_create_enum (NautilusPreferencesItem *item, const NautilusPreferencesInfo *pref_info); static void preferences_item_create_boolean (NautilusPreferencesItem *item, @@ -127,7 +127,7 @@ nautilus_preferences_item_initialize (NautilusPreferencesItem *item) item->details = g_new (NautilusPreferencesItemDetails, 1); item->details->pref_name = NULL; - item->details->item_type = NAUTILUS_PREFERENCES_ITEM_UNKNOWN; + item->details->item_type = -1; item->details->child = NULL; item->details->prefs = NULL; } @@ -232,14 +232,14 @@ static void preferences_item_construct (NautilusPreferencesItem *item, GtkObject *prefs, const gchar *pref_name, - NautilusPreferencesItemType item_type) + NautilusPreferencesType item_type) { const NautilusPreferencesInfo *pref_info; g_return_if_fail (item != NULL); g_return_if_fail (prefs != NULL); g_return_if_fail (pref_name != NULL); - g_return_if_fail (item_type != NAUTILUS_PREFERENCES_ITEM_UNKNOWN); + g_return_if_fail (item_type != -1); g_return_if_fail (item->details->child == NULL); @@ -253,17 +253,13 @@ preferences_item_construct (NautilusPreferencesItem *item, switch (item_type) { - case NAUTILUS_PREFERENCES_ITEM_BOOL: + case NAUTILUS_PREFERENCE_BOOLEAN: preferences_item_create_boolean (item, pref_info); break; - case NAUTILUS_PREFERENCES_ITEM_ENUM: + case NAUTILUS_PREFERENCE_ENUM: preferences_item_create_enum (item, pref_info); break; - - case NAUTILUS_PREFERENCES_ITEM_UNKNOWN: - g_assert_not_reached (); - break; } g_assert (item->details->child != NULL); @@ -350,9 +346,9 @@ preferences_item_create_boolean (NautilusPreferencesItem *item, * NautilusPreferencesItem public methods */ GtkWidget * -nautilus_preferences_item_new (GtkObject *prefs, - const gchar *pref_name, - NautilusPreferencesItemType item_type) +nautilus_preferences_item_new (GtkObject *prefs, + const gchar *pref_name, + NautilusPreferencesType item_type) { NautilusPreferencesItem * item; |