From 51948ccf65b93d04a84f5f0e4cd6cff47c48e1a1 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 9 May 2007 11:01:59 +0100 Subject: Assign the model when done Set the model in OPERATION_MODE_SEARCH and OPERATION_MODE_RECENT only when done loading the search hit or the recent files list, so that we don't get loads of row operations on the browse_files_tree_view widget. Signed-off-by: Emmanuele Bassi --- gtk/gtkfilechooserdefault.c | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c index 9d1ecb5..dbe050e 100644 --- a/gtk/gtkfilechooserdefault.c +++ b/gtk/gtkfilechooserdefault.c @@ -8674,6 +8674,8 @@ search_engine_finished_cb (GtkSearchEngine *engine, impl = GTK_FILE_CHOOSER_DEFAULT (data); /* FMQ: if search was empty, say that we got no hits */ + gtk_tree_view_set_model (GTK_TREE_VIEW (impl->browse_files_tree_view), + GTK_TREE_MODEL (impl->search_model)); set_busy_cursor (impl, FALSE); } @@ -8888,9 +8890,6 @@ search_setup_model (GtkFileChooserDefault *impl) gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (impl->search_model), SEARCH_MODEL_COL_STAT, GTK_SORT_DESCENDING); - - gtk_tree_view_set_model (GTK_TREE_VIEW (impl->browse_files_tree_view), - GTK_TREE_MODEL (impl->search_model)); } /* Creates a new query with the specified text and launches it */ @@ -9208,9 +9207,6 @@ recent_setup_model (GtkFileChooserDefault *impl) gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (impl->recent_model), RECENT_MODEL_COL_INFO, GTK_SORT_DESCENDING); - - gtk_tree_view_set_model (GTK_TREE_VIEW (impl->browse_files_tree_view), - GTK_TREE_MODEL (impl->recent_model)); } typedef struct @@ -9225,10 +9221,14 @@ static void recent_idle_cleanup (gpointer data) { RecentLoadData *load_data = data; + GtkFileChooserDefault *impl = load_data->impl; - set_busy_cursor (load_data->impl, FALSE); + gtk_tree_view_set_model (GTK_TREE_VIEW (impl->browse_files_tree_view), + GTK_TREE_MODEL (impl->recent_model)); + + set_busy_cursor (impl, FALSE); - load_data->impl->load_recent_id = 0; + impl->load_recent_id = 0; if (load_data->items) { -- 1.4.4.2