mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-11 03:10:09 +00:00
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.
This commit is contained in:
parent
f942d6f53c
commit
ffef28a7e8
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user