summaryrefslogtreecommitdiff
path: root/libnautilus-extensions/nautilus-glib-extensions.c
diff options
context:
space:
mode:
authorMaciej Stachowiak <mstachow@src.gnome.org>2000-08-11 07:21:57 +0000
committerMaciej Stachowiak <mstachow@src.gnome.org>2000-08-11 07:21:57 +0000
commit4dbe9d17c84a424007832f066e9a935b7b43eb18 (patch)
tree09d6eda7e92a49133091231f101b3053cec94c02 /libnautilus-extensions/nautilus-glib-extensions.c
parent3afcd9b8688b41b2a20464a6978f11cbf30c1ffd (diff)
downloadnautilus-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-extensions/nautilus-glib-extensions.c')
-rw-r--r--libnautilus-extensions/nautilus-glib-extensions.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/libnautilus-extensions/nautilus-glib-extensions.c b/libnautilus-extensions/nautilus-glib-extensions.c
index ab0385360..f2cb19268 100644
--- a/libnautilus-extensions/nautilus-glib-extensions.c
+++ b/libnautilus-extensions/nautilus-glib-extensions.c
@@ -280,6 +280,34 @@ nautilus_g_list_free_deep (GList *list)
nautilus_g_list_free_deep_custom (list, (GFunc) g_free, NULL);
}
+/**
+ * nautilus_g_list_free_deep_custom
+ *
+ * Frees the elements of a list and then the list, using a custom free function.
+ *
+ * @list: List of elements that can be freed with the provided free function.
+ * @element_free_func: function to call with the data pointer and user_data to free it.
+ * @user_data: User data to pass to element_free_func
+ **/
+void
+nautilus_g_slist_free_deep_custom (GSList *list, GFunc element_free_func, gpointer user_data)
+{
+ g_slist_foreach (list, element_free_func, user_data);
+ g_slist_free (list);
+}
+
+/**
+ * nautilus_g_slist_free_deep
+ *
+ * Frees the elements of a list and then the list.
+ * @list: List of elements that can be freed with g_free.
+ **/
+void
+nautilus_g_slist_free_deep (GSList *list)
+{
+ nautilus_g_slist_free_deep_custom (list, (GFunc) g_free, NULL);
+}
+
/**
* nautilus_g_strv_find