GNOME Bugzilla – Bug 739453
Home and Desktop do not link to correct place in PlacesSideBar
Last modified: 2014-12-01 20:59:06 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.
Created attachment 291845 [details] [review] GtkPlacesSidebar: Fix Home and Desktop on windows.
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
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.
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.
Oops, sorry for the stupidity there. Thanks for catching the bug! I've committed your patch to master and gtk-3-14.