diff options
author | Maciej Stachowiak <mstachow@src.gnome.org> | 2000-08-11 07:21:57 +0000 |
---|---|---|
committer | Maciej Stachowiak <mstachow@src.gnome.org> | 2000-08-11 07:21:57 +0000 |
commit | 4dbe9d17c84a424007832f066e9a935b7b43eb18 (patch) | |
tree | 09d6eda7e92a49133091231f101b3053cec94c02 /libnautilus-private/nautilus-preferences.c | |
parent | 3afcd9b8688b41b2a20464a6978f11cbf30c1ffd (diff) | |
download | nautilus-4dbe9d17c84a424007832f066e9a935b7b43eb18.tar.gz |
Fixes for bugzilla tasks 1525 and 1530.
* components/tree/nautilus-tree-expansion-state.h,
components/tree/nautilus-tree-expansion-state.c: New files
implementing the NautilusTreeExpansionState class, a class to
track the expansion state of various nodes in the tree, and
save/load it to/from GConf.
* components/tree/nautilus-tree-model.h,
components/tree/nautilus-tree-model.c
(nautilus_tree_model_stop_monitoring_node_recursive): New function
to stop monitoring a node and any children of it's that you may be
monitoring all at one go.
(nautilus_tree_model_stop_monitoring_node): Disconnect signal
handlers from the proper object (D'oh!) and avoid disconnecting
more than once if you stop monitoring more than once (D'oh!).
* components/tree/nautilus-tree-view.c:
(nautilus_tree_view_insert_model_node,
nautilus_tree_view_remove_model_node,
nautilus_tree_view_update_model_node),
nautilus_tree_view_initialize, nautilus_tree_view_destroy,
tree_expand_callback, tree_collapse_callback): Track expansion
state using the new class, and make sure that when a node is
expanded it gets reloaded recursively.
(ctree_is_node_expanded): Convenience function to check if a
GtkCTreeNode is currenly expanded.
(reload_node_for_uri): New function to force reload of a node.
(expand_node_for_uri): New function to do everything necessary
associated with the expansion of a node.
* libnautilus-extensions/nautilus-glib-extensions.h,
libnautilus-extensions/nautilus-glib-extensions.c:
(nautilus_g_slist_free_deep_custom, nautilus_g_slist_free_deep):
New functions for freeing GSLists, similar to the GList versions.
* libnautilus-extensions/nautilus-preferences.h,
libnautilus-extensions/nautilus-preferences.c
(nautilus_preferences_set_string_list,
nautilus_preferences_get_string_list): New functions for
manipulating preferences that are a list of strings.
* libnautilus-extensions/nautilus-volume-monitor.c
(mntent_is_removable_fs): Added some FIXMEs
* src/nautilus-view-frame.c: Remove a stary character from the
copyright notice.
Diffstat (limited to 'libnautilus-private/nautilus-preferences.c')
-rw-r--r-- | libnautilus-private/nautilus-preferences.c | 61 |
1 files changed, 60 insertions, 1 deletions
diff --git a/libnautilus-private/nautilus-preferences.c b/libnautilus-private/nautilus-preferences.c index bd6af9466..ab690b02a 100644 --- a/libnautilus-private/nautilus-preferences.c +++ b/libnautilus-private/nautilus-preferences.c @@ -36,9 +36,11 @@ #include <gconf/gconf-client.h> #include <gtk/gtksignal.h> - + static const char PREFERENCES_GCONF_PATH[] = "/apps/nautilus"; +#include <gtk/gtksignal.h> + /* * PreferencesHashNode: * @@ -737,6 +739,63 @@ nautilus_preferences_get_boolean (const char *name, return result; } + +void +nautilus_preferences_set_string_list (const char *name, + GSList *string_list_value) +{ + char *key; + + gboolean gconf_result; + + g_return_if_fail (name != NULL); + + preferences_initialize_if_needed (); + + key = nautilus_user_level_manager_make_current_gconf_key (name); + g_assert (key != NULL); + + /* FIXME: Make sure the preference value is indeed different + before setting, like the other functions */ + + /* FIXME: we are passing NULL for the last argument and thus + missing out on any opportunity to handle errors. */ + + gconf_result = gconf_client_set_list (GLOBAL.gconf_client, key, + GCONF_VALUE_STRING, + string_list_value, + NULL); + + /* FIXME: wrong to assert this, what if there is an error? */ + g_assert (gconf_result); + + gconf_client_suggest_sync (GLOBAL.gconf_client, NULL); + + g_free (key); +} + +GSList * +nautilus_preferences_get_string_list (const char *name) +{ + GSList *result; + char *key; + + g_return_val_if_fail (name != NULL, FALSE); + + preferences_initialize_if_needed (); + + key = nautilus_user_level_manager_make_current_gconf_key (name); + g_assert (key != NULL); + + result = gconf_client_get_list (GLOBAL.gconf_client, key, + GCONF_VALUE_STRING, NULL); + + g_free (key); + + return result; +} + + void nautilus_preferences_set_enum (const char *name, int enum_value) |