[gtk/gbsneto/filechooser-column-view] filechooser: Make search results show up
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/gbsneto/filechooser-column-view] filechooser: Make search results show up
- Date: Fri, 21 Oct 2022 01:15:33 +0000 (UTC)
commit e2b015a0bee23205fe92b81370e760efc037ca1d
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Oct 20 21:14:29 2022 -0400
filechooser: Make search results show up
The tracker search engine implementation was not
setting all the custom attributes that we require
now.
The quartz search engine will need similar fixes.
gtk/gtksearchenginetracker3.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtksearchenginetracker3.c b/gtk/gtksearchenginetracker3.c
index 6918983941..5ecb2ca211 100644
--- a/gtk/gtksearchenginetracker3.c
+++ b/gtk/gtksearchenginetracker3.c
@@ -114,7 +114,8 @@ free_hit (gpointer data)
}
static GFileInfo *
-create_file_info (TrackerSparqlCursor *cursor)
+create_file_info (GFile *file,
+ TrackerSparqlCursor *cursor)
{
GFileInfo *info;
const char *str;
@@ -140,6 +141,10 @@ create_file_info (TrackerSparqlCursor *cursor)
g_date_time_unref (creation);
}
+ g_file_info_set_attribute_object (info, "standard::file", G_OBJECT (file));
+ g_file_info_set_attribute_boolean (info, "filechooser::filtered-out", FALSE);
+ g_file_info_set_attribute_boolean (info, "filechooser::visible", TRUE);
+
return info;
}
@@ -175,7 +180,7 @@ query_callback (TrackerSparqlStatement *statement,
url = tracker_sparql_cursor_get_string (cursor, 0, NULL);
hit = g_slice_new0 (GtkSearchHit);
hit->file = g_file_new_for_uri (url);
- hit->info = create_file_info (cursor);
+ hit->info = create_file_info (hit->file, cursor);
hits = g_list_prepend (hits, hit);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]