GNOME Bugzilla – Bug 765858
file chooser generates a warning about a network path
Last modified: 2016-05-02 09:56:58 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.
Z:\dan\app\repo\src is the current working directory, by the way. There is no "network" subdirectory.
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().
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.
I've tested the above patch on my Windows system and it successfully suppresses the console warning.
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.
Attachment 327117 [details] pushed as bab628b - GtkPlacesView: check for network:// URI support before using it