Commit ffef28a7 authored by Matthias Clasen's avatar Matthias Clasen

iconview: Fix updates with filter models

Filter models rely on views taking a ref on every node
they care about. GtkIconView was not doing that. Amazingly,
this has never shown up in a bug so far, until I spotted
the fallout in gnome-font-viewer.
parent f942d6f5
......@@ -3270,6 +3270,8 @@ gtk_icon_view_row_inserted (GtkTreeModel *model,
if (gtk_tree_path_get_depth (path) > 1)
return;
gtk_tree_model_ref_node (model, iter);
index = gtk_tree_path_get_indices(path)[0];
item = gtk_icon_view_item_new ();
......@@ -3306,11 +3308,15 @@ gtk_icon_view_row_deleted (GtkTreeModel *model,
GtkIconViewItem *item;
GList *list, *next;
gboolean emit = FALSE;
GtkTreeIter iter;
/* ignore changes in branches */
if (gtk_tree_path_get_depth (path) > 1)
return;
gtk_tree_model_get_iter (model, &iter, path);
gtk_tree_model_unref_node (model, &iter);
index = gtk_tree_path_get_indices(path)[0];
list = g_list_nth (icon_view->priv->items, index);
......
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