summaryrefslogtreecommitdiff
path: root/gtk/gtkfilesystemmodel.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2015-06-18 15:18:30 -0400
committerMatthias Clasen <mclasen@redhat.com>2015-06-18 15:20:06 -0400
commit1d63335c8e51aee978521afdc77880a912b9f743 (patch)
treede139f408aba423b3ce205d2e8c5f1e56db07b4b /gtk/gtkfilesystemmodel.c
parent1b755c546e5ab0693ae921f7febc1c8bb439193f (diff)
downloadgtk+-1d63335c8e51aee978521afdc77880a912b9f743.tar.gz
Use infos from search engine instead of getting them again
When the search engine provides hits with GFileInfo, use that to add the hits to the model directly, without going through another round of async get_info calls. To do this, we add a batched variant of the _gtk_file_system_model_update_file call that takes lists of GFiles and GFileInfos. Again, we can avoid repeated resorting that happens when the files are updated individually.
Diffstat (limited to 'gtk/gtkfilesystemmodel.c')
-rw-r--r--gtk/gtkfilesystemmodel.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gtk/gtkfilesystemmodel.c b/gtk/gtkfilesystemmodel.c
index 096836bb64..3f7e7b1d24 100644
--- a/gtk/gtkfilesystemmodel.c
+++ b/gtk/gtkfilesystemmodel.c
@@ -1962,6 +1962,23 @@ _gtk_file_system_model_update_file (GtkFileSystemModel *model,
emit_row_changed_for_node (model, id);
}
+void
+_gtk_file_system_model_update_files (GtkFileSystemModel *model,
+ GList *files,
+ GList *infos)
+{
+ GList *l, *i;
+
+ g_return_if_fail (GTK_IS_FILE_SYSTEM_MODEL (model));
+
+ freeze_updates (model);
+
+ for (l = files, i = infos; l; l = l->next, i = i->next)
+ _gtk_file_system_model_update_file (model, (GFile *)l->data, (GFileInfo *)i->data);
+
+ thaw_updates (model);
+}
+
/**
* _gtk_file_system_model_set_filter:
* @mode: a #GtkFileSystemModel