GNOME Bugzilla – Bug 415342
Should add the default Downloads folder to the filechoosers
Last modified: 2007-04-25 08:44:14 UTC
+++ This bug was initially created as a clone of Bug #415338 +++ As well as the currently selected "Downloads" folder from the prefs. You can use http://freedesktop.org/wiki/Software_2fxdg_2duser_2ddirs to get the default Downloads folder for the user.
Created attachment 85568 [details] [review] ephy-use-xdg-dirs.patch Implement the above. It will use the old codepath if xdg-user-dirs isn't available. I committed similar changes to trunk and gnome-2-18 for Totem and Sound-juicer already.
+static char * +ephy_file_downloads_dir_from_xdg (void) +{ + const char *home_dir; + char *downloads_dir; + + home_dir = getenv ("HOME"); Let's at least add a comment why we're not using g_get_home_dir() here. I hope there'll be a glib-y version of xdg_user_dir_lookup soon... Using this XDG setting will make the download folder pref obsolete; can you file a follow-up bug about removing the setting from epiphany?
(In reply to comment #2) > +static char * > +ephy_file_downloads_dir_from_xdg (void) > +{ > + const char *home_dir; > + char *downloads_dir; > + > + home_dir = getenv ("HOME"); > > Let's at least add a comment why we're not using g_get_home_dir() here. > I hope there'll be a glib-y version of xdg_user_dir_lookup soon... Done > Using this XDG setting will make the download folder pref obsolete; can you > file a follow-up bug about removing the setting from epiphany? Sure, filed as bug 432652 I also filed bug 432651 about getting a glib version of the xdg code.
Created attachment 86855 [details] [review] ephy-use-xdg-dirs-2.patch
Was this OK to commit just to trunk, or to both trunk and gnome-2-18 (as it doesn't change the behaviour in the non-xdg-user-dirs case).
Just trunk. It's not really equivalent for non-xdg-user-dirs case, since it returns /tmp if $HOME is unset (which isn't the same as the user having no home dir).
Fair enough, fixed in trunk. 2007-04-23 Bastien Nocera <hadess@hadess.net> * lib/ephy-file-helpers.c: (xdg_user_dir_lookup), (ephy_file_downloads_dir_from_xdg), (ephy_file_downloads_dir): Use xdg-user-dirs to get a better default Downloads directory (Closes: #415342)
*** Bug 359082 has been marked as a duplicate of this bug. ***