Commit 0c4f29e8 authored by Kristian Rietveld's avatar Kristian Rietveld

When the filter removes a node, it needs to remove its children too

In gtk_tree_model_filter_remove_node(), we check if the given elt has
children.  If so, this level will be freed.  This action is recursive.
parent bf573a1e
......@@ -1008,9 +1008,13 @@ gtk_tree_model_filter_remove_node (GtkTreeModelFilter *filter,
GtkTreePath *path;
FilterElt *tmp;
/* we emit row-deleted, and remove the node from the cache.
/* We emit row-deleted, and remove the node from the cache.
* If it has any children, these will be removed here as well.
*/
if (elt->children)
gtk_tree_model_filter_free_level (filter, elt->children);
path = gtk_tree_model_get_path (GTK_TREE_MODEL (filter), iter);
elt->visible = FALSE;
gtk_tree_model_filter_increment_stamp (filter);
......@@ -1052,10 +1056,16 @@ gtk_tree_model_filter_remove_node (GtkTreeModelFilter *filter,
{
GtkTreePath *path;
/* we emit row-deleted, but keep the node in the cache and
* referenced.
/* We emit row-deleted, but keep the node in the cache and
* referenced. Its children will be removed.
*/
if (elt->children)
{
gtk_tree_model_filter_free_level (filter, elt->children);
elt->children = NULL;
}
path = gtk_tree_model_get_path (GTK_TREE_MODEL (filter), iter);
elt->visible = FALSE;
gtk_tree_model_filter_increment_stamp (filter);
......@@ -1066,7 +1076,7 @@ gtk_tree_model_filter_remove_node (GtkTreeModelFilter *filter,
{
GtkTreePath *path;
/* blow level away */
/* Blow level away, including any child levels */
path = gtk_tree_model_get_path (GTK_TREE_MODEL (filter), iter);
elt->visible = FALSE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment