summaryrefslogtreecommitdiff
path: root/gtk/gtkfilechooserwidget.c
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2020-05-17 00:00:22 +0200
committerCarlos Garnacho <carlosg@gnome.org>2020-05-19 22:04:25 +0200
commitb890e878185a0bffe2669a210e1eddbfc9485dec (patch)
tree3b0a8d3cfc19dc6ad21049dda1308afacc2b06bd /gtk/gtkfilechooserwidget.c
parente0f4e44044ec044cb09f571fc7943f296da789d0 (diff)
downloadgtk+-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.c3
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);