From 9b0b3029a6b90834aa96ca3ad2123fd9dd9a64f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Wed, 8 Mar 2023 20:04:41 +0100 Subject: [PATCH] filechooser: Use gtk_recent_info_is_local() for filtering There is already a function for determining if URI has the "file" scheme, so use that. --- gtk/gtkfilechooserwidget.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c index baecc10aaa..f2c76d56ee 100644 --- a/gtk/gtkfilechooserwidget.c +++ b/gtk/gtkfilechooserwidget.c @@ -641,11 +641,10 @@ _gtk_file_chooser_extract_recent_folders (GList *infos) GFile *parent; GFile *file; - uri = gtk_recent_info_get_uri (info); - - if (!g_str_has_prefix (uri, "file://")) + if (!gtk_recent_info_is_local (info)) continue; + uri = gtk_recent_info_get_uri (info); file = g_file_new_for_uri (uri); parent = g_file_get_parent (file); g_object_unref (file); @@ -5996,8 +5995,7 @@ recent_start_loading (GtkFileChooserWidget *impl) GtkRecentInfo *info = l->data; GFile *file; - const char *uri = gtk_recent_info_get_uri (info); - if (!g_str_has_prefix (uri, "file://")) + if (!gtk_recent_info_is_local (info)) continue; if (gtk_recent_info_get_private_hint (info) &&