Merge branch 'ebassi/issue-5650' into 'main'

Filter recently used files in the file chooser

Closes #5650

See merge request GNOME/gtk!5618
This commit is contained in:
Matthias Clasen 2023-03-08 18:45:10 +00:00
commit f743b95161

View File

@ -643,6 +643,9 @@ _gtk_file_chooser_extract_recent_folders (GList *infos)
uri = gtk_recent_info_get_uri (info); uri = gtk_recent_info_get_uri (info);
if (!g_str_has_prefix (uri, "file://"))
continue;
file = g_file_new_for_uri (uri); file = g_file_new_for_uri (uri);
parent = g_file_get_parent (file); parent = g_file_get_parent (file);
g_object_unref (file); g_object_unref (file);
@ -5993,6 +5996,10 @@ recent_start_loading (GtkFileChooserWidget *impl)
GtkRecentInfo *info = l->data; GtkRecentInfo *info = l->data;
GFile *file; GFile *file;
const char *uri = gtk_recent_info_get_uri (info);
if (!g_str_has_prefix (uri, "file://"))
continue;
if (gtk_recent_info_get_private_hint (info) && if (gtk_recent_info_get_private_hint (info) &&
!gtk_recent_info_has_application (info, app_name)) !gtk_recent_info_has_application (info, app_name))
continue; continue;