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 415342 - Should add the default Downloads folder to the filechoosers
Should add the default Downloads folder to the filechoosers
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: Downloads
git master
Other Linux
: Normal enhancement
: ---
Assigned To: Epiphany Maintainers
Marco Pesenti Gritti
: 359082 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-03-06 15:14 UTC by Bastien Nocera
Modified: 2007-04-25 08:44 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
ephy-use-xdg-dirs.patch (3.60 KB, patch)
2007-03-30 16:04 UTC, Bastien Nocera
accepted-commit_now Details | Review
ephy-use-xdg-dirs-2.patch (3.75 KB, patch)
2007-04-23 16:03 UTC, Bastien Nocera
committed Details | Review

Description Bastien Nocera 2007-03-06 15:14:29 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.
Comment 1 Bastien Nocera 2007-03-30 16:04:45 UTC
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.
Comment 2 Christian Persch 2007-04-20 13:39:07 UTC
+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?

Comment 3 Bastien Nocera 2007-04-23 16:01:44 UTC
(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.
Comment 4 Bastien Nocera 2007-04-23 16:03:02 UTC
Created attachment 86855 [details] [review]
ephy-use-xdg-dirs-2.patch
Comment 5 Bastien Nocera 2007-04-23 16:29:45 UTC
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).
Comment 6 Christian Persch 2007-04-23 17:02:55 UTC
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).
Comment 7 Bastien Nocera 2007-04-23 17:17:08 UTC
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)
Comment 8 Christian Persch 2007-04-25 08:44:14 UTC
*** Bug 359082 has been marked as a duplicate of this bug. ***