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 739453 - Home and Desktop do not link to correct place in PlacesSideBar
Home and Desktop do not link to correct place in PlacesSideBar
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
3.14.x
Other Windows
: Normal normal
: ---
Assigned To: gtk-bugs
Federico Mena Quintero
Depends on:
Blocks:
 
 
Reported: 2014-10-31 15:55 UTC by S Hatford
Modified: 2014-12-01 20:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GtkPlacesSidebar: Fix Home and Desktop on windows. (1.71 KB, patch)
2014-11-30 20:41 UTC, Matias De lellis
none Details | Review
GtkPlacesSidebar: Fix Home and Desktop on windows V2. (1.33 KB, patch)
2014-11-30 23:00 UTC, Matias De lellis
none Details | Review

Description S Hatford 2014-10-31 15:55:00 UTC
Both the home and desktop shortcut links to the current working directory

Steps to reproduce:

* Create a file chooser dialog 
* Click on the home shortcut or desktop shortcut

Actual Results:

The home shortcut and desktop shortcut link to the current working directory

Expected Results:

The desktop shortcut links to the desktop
The home shortcut links to the home folder

Platform:
Gtk+ 3.14.1
Python bindings (Pygobject)
Python 3.4.2 32bit
Windows 7

Additional Information:

If you do ALT-d in the filechooser it correctly moves to the Desktop.
Comment 1 Matias De lellis 2014-11-30 20:41:07 UTC
Created attachment 291845 [details] [review]
GtkPlacesSidebar: Fix Home and Desktop on windows.
Comment 2 Matias De lellis 2014-11-30 20:48:37 UTC
Hi,

I'm new on gnome community. Just create the account to upload the patch.

The bug is so simple:
 * https://git.gnome.org/browse/gtk+/tree/gtk/gtkplacessidebar.c#n693
 * https://git.gnome.org/browse/gtk+/tree/gtk/gtkplacessidebar.c#n709

When concatenating "file://" to a path (Returned from g_get_user_special_dir()) not always get a correct uri..

On unix: g_get_user_special_dir() return ig: "/home/matias" and concatenating you get "file:///home/matias", that is a correct uri.

On windows: g_get_user_special_dir() return ig: "c:\users\matias\" and concatenating you get "file://c:\user\matias", but the correct uri is: "file:///c:\user\matias"

p.s: Not know if it meets all standards, but more than an hour ago that I'm trying to clone the main repository to do it well, and finally I edit it on github. :S


Regards,
Matias
Comment 3 Matias De lellis 2014-11-30 22:04:20 UTC
Hi,
A more simple alternative, but that still could not test. Change the concatenation to g_filename_to_uri():

- https://git.gnome.org/browse/gtk+/tree/gtk/gtkplacessidebar.c#n693
+ return g_filename_to_uri(home, NULL, NULL);

and

- https://git.gnome.org/browse/gtk+/tree/gtk/gtkplacessidebar.c#n709
+ return g_filename_to_uri(name, NULL, NULL);

I honestly do not understand why they not did this, instead of strange concatenations. haha. =)

Regards.
Comment 4 Matias De lellis 2014-11-30 23:00:51 UTC
Created attachment 291850 [details] [review]
GtkPlacesSidebar: Fix Home and Desktop on windows V2.

Replaces concatenations by g_filename_to_uri() to get correct uris in windows.
Comment 5 Federico Mena Quintero 2014-12-01 20:59:06 UTC
Oops, sorry for the stupidity there.  Thanks for catching the bug!

I've committed your patch to master and gtk-3-14.