After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 765858 - file chooser generates a warning about a network path
file chooser generates a warning about a network path
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
3.20.x
Other Windows
: Normal normal
: ---
Assigned To: gtk-bugs
Federico Mena Quintero
Depends on:
Blocks:
 
 
Reported: 2016-04-30 18:25 UTC by draymond
Modified: 2016-05-02 09:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GtkPlacesView: check for network:// URI support before using it (1.49 KB, patch)
2016-05-01 19:04 UTC, LRN
committed Details | Review

Description draymond 2016-04-30 18:25:59 UTC
I am getting the following warning on the console:

Gtk-WARNING **: Failed to fetch network locations: Error opening directory 'Z:\dan\app\repo\src\network:': No such file or directory

This behavior is seen on GTK+ 3.20.3.  It was not seen on GTK+ 3.16.2.
To produce this warning I run my GTK application (from an MSYS2 console under Windows 10), open a file chooser window, and close my GTK application.
Comment 1 draymond 2016-04-30 18:51:10 UTC
Z:\dan\app\repo\src is the current working directory, by the way.  There is no "network" subdirectory.
Comment 2 draymond 2016-05-01 06:13:15 UTC
The trouble appears to originate in fetch_networks() from gtkplacesview.c.  Here it tries to open the file "network:///" and when it fails it logs a warning to the console.  The problem can be suppressed by commenting out the call to fetch_networks().
Comment 3 LRN 2016-05-01 19:04:34 UTC
Created attachment 327117 [details] [review]
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.
Comment 4 draymond 2016-05-01 20:40:15 UTC
I've tested the above patch on my Windows system and it successfully suppresses the console warning.
Comment 5 Matthias Clasen 2016-05-02 01:18:49 UTC
Review of attachment 327117 [details] [review]:

::: gtk/gtkplacesview.c
@@ +1014,3 @@
+  for (found = FALSE; !found && supported_uris && supported_uris[0]; supported_uris++)
+    if (g_strcmp0 (supported_uris[0], "network") == 0)
+      found = TRUE;

I prefer to write such loops as for (i = 0; supported_uris[i]; i++) ...
but this works too.
Comment 6 LRN 2016-05-02 09:56:54 UTC
Attachment 327117 [details] pushed as bab628b - GtkPlacesView: check for network:// URI support before using it