summaryrefslogtreecommitdiff
path: root/gtk/gtkiconview.c
diff options
context:
space:
mode:
authorMatthias Clasen <matthiasc@src.gnome.org>2008-12-13 05:28:21 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2008-12-13 05:28:21 +0000
commit82cdd4b90303fd829e183ac72c60676cd75c1b51 (patch)
tree83936066d3a554841076aac5f039853017e46b1b /gtk/gtkiconview.c
parent1934d3423bf317823de727d81da87f01f0eeb3d0 (diff)
downloadgtk+-82cdd4b90303fd829e183ac72c60676cd75c1b51.tar.gz
Use the new order correctly. Patch by Li Yuan
* gtk/gtkiconview.c (gtk_icon_view_accessible_model_rows_reordered): Use the new order correctly. Patch by Li Yuan svn path=/trunk/; revision=21878
Diffstat (limited to 'gtk/gtkiconview.c')
-rw-r--r--gtk/gtkiconview.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index 05ad6b5a6a..f22f70b78b 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -9003,20 +9003,29 @@ gtk_icon_view_accessible_model_rows_reordered (GtkTreeModel *tree_model,
GtkIconViewItemAccessible *item;
GList *items;
AtkObject *atk_obj;
+ gint *order;
+ gint length, i;
atk_obj = gtk_widget_get_accessible (GTK_WIDGET (user_data));
icon_view = GTK_ICON_VIEW (user_data);
priv = gtk_icon_view_accessible_get_priv (atk_obj);
+ length = gtk_tree_model_iter_n_children (tree_model, NULL);
+
+ order = g_new (gint, length);
+ for (i = 0; i < length; i++)
+ order [new_order[i]] = i;
+
items = priv->items;
while (items)
{
info = items->data;
item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (info->item);
- info->index = new_order[info->index];
+ info->index = order[info->index];
item->item = g_list_nth_data (icon_view->priv->items, info->index);
items = items->next;
}
+ g_free (order);
priv->items = g_list_sort (priv->items,
(GCompareFunc)gtk_icon_view_accessible_item_compare);