# HG changeset patch # User nadvornik # Date 1212956686 0 # Node ID e702eaa6d1df171d65712ba1d307ec8891f21496 # Parent 764fd82dd0992a5e6e25ff929b402de14ce8c5d0 vficon_sync speed-up diff -r 764fd82dd099 -r e702eaa6d1df src/view_file_icon.c --- a/src/view_file_icon.c Sun Jun 08 19:09:44 2008 +0000 +++ b/src/view_file_icon.c Sun Jun 08 20:24:46 2008 +0000 @@ -1622,6 +1622,7 @@ GtkTreeIter iter; GList *work; gint r, c; + gint valid; if (VFICON_INFO(vf, rows) == 0) return; @@ -1630,13 +1631,15 @@ r = -1; c = 0; + valid = gtk_tree_model_iter_children(store, &iter, NULL); + work = vf->list; while (work) { GList *list; r++; c = 0; - if (gtk_tree_model_iter_nth_child(store, &iter, NULL, r)) + if (valid) { gtk_tree_model_get(store, &iter, FILE_COLUMN_POINTER, &list, -1); gtk_list_store_set(GTK_LIST_STORE(store), &iter, FILE_COLUMN_POINTER, list, -1); @@ -1666,15 +1669,16 @@ list->data = id; list = list->next; } + if (valid) valid = gtk_tree_model_iter_next(store, &iter); } r++; - while (gtk_tree_model_iter_nth_child(store, &iter, NULL, r)) + while (valid) { GList *list; gtk_tree_model_get(store, &iter, FILE_COLUMN_POINTER, &list, -1); - gtk_list_store_remove(GTK_LIST_STORE(store), &iter); + valid = gtk_list_store_remove(GTK_LIST_STORE(store), &iter); g_list_free(list); }