diff options
author | Benjamin Otte <otte@redhat.com> | 2012-05-04 18:44:39 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2012-05-07 00:12:26 +0200 |
commit | 63ddb3f2c7ec6fc89670d82808f86f9d807a3380 (patch) | |
tree | 8ea61a9143690a91502c1fae9823a25c9dc895ad | |
parent | ee91e272a8926489f9df3a7c05c36f0eb34c5384 (diff) | |
download | gtk+-63ddb3f2c7ec6fc89670d82808f86f9d807a3380.tar.gz |
iconview: Don't cache iters
This is a huge quest to remove all caching from GtkIconview to simplify
the code. As it turns out, iconview performance is a joke, so the caches
are kinda unnecessary.
If we need caching, we can add it in a useful way later.
-rw-r--r-- | gtk/gtkiconview.c | 31 | ||||
-rw-r--r-- | gtk/gtkiconviewprivate.h | 1 |
2 files changed, 5 insertions, 27 deletions
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c index 5f3bf5b0c2..1afeed6743 100644 --- a/gtk/gtkiconview.c +++ b/gtk/gtkiconview.c @@ -3186,22 +3186,16 @@ gtk_icon_view_row_inserted (GtkTreeModel *model, GtkIconView *icon_view = GTK_ICON_VIEW (data); gint index; GtkIconViewItem *item; - gboolean iters_persist; GList *list; /* ignore changes in branches */ if (gtk_tree_path_get_depth (path) > 1) return; - iters_persist = gtk_tree_model_get_flags (icon_view->priv->model) & GTK_TREE_MODEL_ITERS_PERSIST; - index = gtk_tree_path_get_indices(path)[0]; item = gtk_icon_view_item_new (); - if (iters_persist) - item->iter = *iter; - item->index = index; /* FIXME: We can be more efficient here, @@ -3330,11 +3324,8 @@ gtk_icon_view_build_items (GtkIconView *icon_view) { GtkTreeIter iter; int i; - gboolean iters_persist; GList *items = NULL; - iters_persist = gtk_tree_model_get_flags (icon_view->priv->model) & GTK_TREE_MODEL_ITERS_PERSIST; - if (!gtk_tree_model_get_iter_first (icon_view->priv->model, &iter)) return; @@ -3345,9 +3336,6 @@ gtk_icon_view_build_items (GtkIconView *icon_view) { GtkIconViewItem *item = gtk_icon_view_item_new (); - if (iters_persist) - item->iter = iter; - item->index = i; i++; @@ -4075,22 +4063,13 @@ void _gtk_icon_view_set_cell_data (GtkIconView *icon_view, GtkIconViewItem *item) { - gboolean iters_persist; GtkTreeIter iter; + GtkTreePath *path; - iters_persist = gtk_tree_model_get_flags (icon_view->priv->model) & GTK_TREE_MODEL_ITERS_PERSIST; - - if (!iters_persist) - { - GtkTreePath *path; - - path = gtk_tree_path_new_from_indices (item->index, -1); - if (!gtk_tree_model_get_iter (icon_view->priv->model, &iter, path)) - return; - gtk_tree_path_free (path); - } - else - iter = item->iter; + path = gtk_tree_path_new_from_indices (item->index, -1); + if (!gtk_tree_model_get_iter (icon_view->priv->model, &iter, path)) + return; + gtk_tree_path_free (path); gtk_cell_area_apply_attributes (icon_view->priv->cell_area, icon_view->priv->model, diff --git a/gtk/gtkiconviewprivate.h b/gtk/gtkiconviewprivate.h index 81ffd991db..b510037d52 100644 --- a/gtk/gtkiconviewprivate.h +++ b/gtk/gtkiconviewprivate.h @@ -25,7 +25,6 @@ struct _GtkIconViewItem { GdkRectangle cell_area; - GtkTreeIter iter; gint index; gint row, col; |