diff options
author | Barnabás Pőcze <pobrn@protonmail.com> | 2023-03-08 20:04:41 +0100 |
---|---|---|
committer | Barnabás Pőcze <pobrn@protonmail.com> | 2023-03-08 20:04:41 +0100 |
commit | 9b0b3029a6b90834aa96ca3ad2123fd9dd9a64f5 (patch) | |
tree | ab45d32c1b5b762bc7528d4d5f6b2d32c564ffe6 | |
parent | f743b9516127970367700112ca7f6cd3857dcf87 (diff) | |
download | gtk+-9b0b3029a6b90834aa96ca3ad2123fd9dd9a64f5.tar.gz |
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.
-rw-r--r-- | gtk/gtkfilechooserwidget.c | 8 |
1 files 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) && |