From 0aaac89cfda2128b7a981ec8146c25bd0acdf74b Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 28 Sep 2004 19:19:49 +0000 Subject: [PATCH] Turn off sorting while inserting batches of new files, since sorting is 2004-09-28 Matthias Clasen * gtk/gtkfilechooserentry.c (update_current_folder_files): Turn off sorting while inserting batches of new files, since sorting is slow with the current list store implementation. --- ChangeLog | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ ChangeLog.pre-2-6 | 6 ++++++ ChangeLog.pre-2-8 | 6 ++++++ gtk/gtkfilechooserentry.c | 11 ++++++++--- 5 files changed, 32 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index e6c5244a1f..e7623837e1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-09-28 Matthias Clasen + + * gtk/gtkfilechooserentry.c (update_current_folder_files): Turn + off sorting while inserting batches of new files, since sorting + is slow with the current list store implementation. + 2004-09-27 Matthias Clasen * gtk/gtkliststore.c: Allow to disable sorting. This is meant diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index e6c5244a1f..e7623837e1 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +2004-09-28 Matthias Clasen + + * gtk/gtkfilechooserentry.c (update_current_folder_files): Turn + off sorting while inserting batches of new files, since sorting + is slow with the current list store implementation. + 2004-09-27 Matthias Clasen * gtk/gtkliststore.c: Allow to disable sorting. This is meant diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index e6c5244a1f..e7623837e1 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +2004-09-28 Matthias Clasen + + * gtk/gtkfilechooserentry.c (update_current_folder_files): Turn + off sorting while inserting batches of new files, since sorting + is slow with the current list store implementation. + 2004-09-27 Matthias Clasen * gtk/gtkliststore.c: Allow to disable sorting. This is meant diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index e6c5244a1f..e7623837e1 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +2004-09-28 Matthias Clasen + + * gtk/gtkfilechooserentry.c (update_current_folder_files): Turn + off sorting while inserting batches of new files, since sorting + is slow with the current list store implementation. + 2004-09-27 Matthias Clasen * gtk/gtkliststore.c: Allow to disable sorting. This is meant diff --git a/gtk/gtkfilechooserentry.c b/gtk/gtkfilechooserentry.c index 7ae111825b..d1ccc33fec 100644 --- a/gtk/gtkfilechooserentry.c +++ b/gtk/gtkfilechooserentry.c @@ -522,7 +522,10 @@ update_current_folder_files (GtkFileChooserEntry *chooser_entry, g_assert (chooser_entry->completion_store != NULL); - /* Bah. Need to turn off sorting */ + /* Turn off sorting, since it is slow with the default list store implementation */ + gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (chooser_entry->completion_store), + -2, GTK_SORT_ASCENDING); + for (tmp_list = added_uris; tmp_list; tmp_list = tmp_list->next) { GtkFileInfo *info; @@ -535,9 +538,11 @@ update_current_folder_files (GtkFileChooserEntry *chooser_entry, NULL); /* NULL-GError */ if (info) { - const gchar *display_name = gtk_file_info_get_display_name (info); + const gchar *display_name; GtkTreeIter iter; + display_name = gtk_file_info_get_display_name (info); + gtk_list_store_append (chooser_entry->completion_store, &iter); gtk_list_store_set (chooser_entry->completion_store, &iter, DISPLAY_NAME_COLUMN, display_name, @@ -548,7 +553,7 @@ update_current_folder_files (GtkFileChooserEntry *chooser_entry, } } - /* FIXME: we want to turn off sorting temporarily. I suck... */ + /* Turn sorting back on */ gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (chooser_entry->completion_store), DISPLAY_NAME_COLUMN, GTK_SORT_ASCENDING);