From: Barnabás Pőcze Date: Wed, 8 Mar 2023 19:04:41 +0000 (+0100) Subject: filechooser: Use gtk_recent_info_is_local() for filtering X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~5^2~37^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=9b0b3029a6b90834aa96ca3ad2123fd9dd9a64f5;p=gtk4.git 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. --- 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) &&