diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2020-05-17 00:00:22 +0200 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2020-05-19 22:04:25 +0200 |
commit | b890e878185a0bffe2669a210e1eddbfc9485dec (patch) | |
tree | 3b0a8d3cfc19dc6ad21049dda1308afacc2b06bd /gtk/gtkfilechooserwidget.c | |
parent | e0f4e44044ec044cb09f571fc7943f296da789d0 (diff) | |
download | gtk+-b890e878185a0bffe2669a210e1eddbfc9485dec.tar.gz |
gtksearchengine: Add "got_results" argument to ::finished
The filechooser tries to figure out whether it got results by poking
the model, but all files might go through the async GFileInfo querying
state.
Make all search engines (and the composite one) just notify about this
fact, so the file chooser can behave appropriately without waiting for
the async operations to finish.
Diffstat (limited to 'gtk/gtkfilechooserwidget.c')
-rw-r--r-- | gtk/gtkfilechooserwidget.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c index ba4961c280..17ffea9429 100644 --- a/gtk/gtkfilechooserwidget.c +++ b/gtk/gtkfilechooserwidget.c @@ -6535,6 +6535,7 @@ search_engine_hits_added_cb (GtkSearchEngine *engine, /* Callback used from GtkSearchEngine when the query is done running */ static void search_engine_finished_cb (GtkSearchEngine *engine, + gboolean got_results, gpointer data) { GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (data); @@ -6548,7 +6549,7 @@ search_engine_finished_cb (GtkSearchEngine *engine, impl->show_progress_timeout = 0; } - if (gtk_tree_model_iter_n_children (GTK_TREE_MODEL (impl->search_model), NULL) == 0) + if (!got_results) { gtk_stack_set_visible_child_name (GTK_STACK (impl->browse_files_stack), "empty"); gtk_widget_grab_focus (impl->search_entry); |