From bab628beb23f74e8035878e0c4cc54309b2a7995 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1?= =?UTF-8?q?=D1=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= Date: Sun, 1 May 2016 19:00:25 +0000 Subject: [PATCH] GtkPlacesView: check for network:// URI support before using it Specifically, this URI is not supported on Windows, but GFile will do its "best" and turn it into GLocalFile("$pwd/network"), with spectacularly bad results. https://bugzilla.gnome.org/show_bug.cgi?id=765858 --- gtk/gtkplacesview.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gtk/gtkplacesview.c b/gtk/gtkplacesview.c index 1b3660f5da..19af4ed570 100644 --- a/gtk/gtkplacesview.c +++ b/gtk/gtkplacesview.c @@ -19,6 +19,7 @@ #include "config.h" #include +#include #include #include "gtkintl.h" @@ -1004,8 +1005,19 @@ fetch_networks (GtkPlacesView *view) { GtkPlacesViewPrivate *priv; GFile *network_file; + const gchar * const *supported_uris; + gboolean found; priv = gtk_places_view_get_instance_private (view); + supported_uris = g_vfs_get_supported_uri_schemes (g_vfs_get_local ()); + + for (found = FALSE; !found && supported_uris && supported_uris[0]; supported_uris++) + if (g_strcmp0 (supported_uris[0], "network") == 0) + found = TRUE; + + if (!found) + return; + network_file = g_file_new_for_uri ("network:///"); g_cancellable_cancel (priv->networks_fetching_cancellable);