aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ephy-file-helpers.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-10-02 22:25:00 +0800
committerChristian Persch <chpe@src.gnome.org>2004-10-02 22:25:00 +0800
commit5d5a8b49ca1742cc34161ba73287540f779795a5 (patch)
treefcccf2693cdf8ca82c44003184d5fc9f1f624e6e /lib/ephy-file-helpers.c
parent59c38b2fabd382321fbcf1e4a8db70c8c59016ec (diff)
downloadgsoc2013-epiphany-5d5a8b49ca1742cc34161ba73287540f779795a5.tar
gsoc2013-epiphany-5d5a8b49ca1742cc34161ba73287540f779795a5.tar.gz
gsoc2013-epiphany-5d5a8b49ca1742cc34161ba73287540f779795a5.tar.bz2
gsoc2013-epiphany-5d5a8b49ca1742cc34161ba73287540f779795a5.tar.lz
gsoc2013-epiphany-5d5a8b49ca1742cc34161ba73287540f779795a5.tar.xz
gsoc2013-epiphany-5d5a8b49ca1742cc34161ba73287540f779795a5.tar.zst
gsoc2013-epiphany-5d5a8b49ca1742cc34161ba73287540f779795a5.zip
Recognise "Desktop" special downloads directory. Fixes bug #152926.
2004-10-02 Christian Persch <chpe@cvs.gnome.org> * embed/mozilla/MozDownload.cpp: * lib/ephy-file-helpers.c: (ephy_file_downloads_dir), (ephy_file_desktop_dir): * lib/ephy-file-helpers.h: * src/prefs-dialog.c: (get_download_button_label): Recognise "Desktop" special downloads directory. Fixes bug #152926.
Diffstat (limited to 'lib/ephy-file-helpers.c')
-rw-r--r--lib/ephy-file-helpers.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/lib/ephy-file-helpers.c b/lib/ephy-file-helpers.c
index 138d8719f..49f4c487d 100644
--- a/lib/ephy-file-helpers.c
+++ b/lib/ephy-file-helpers.c
@@ -72,8 +72,7 @@ char *
ephy_file_downloads_dir (void)
{
const char *translated_folder;
- char *converted, *downloads_dir;
- gboolean desktop_is_home;
+ char *desktop_dir, *converted, *downloads_dir;
/* The name of the default downloads folder */
translated_folder = _("Downloads");
@@ -81,21 +80,33 @@ ephy_file_downloads_dir (void)
converted = g_filename_from_utf8 (translated_folder, -1, NULL,
NULL, NULL);
+ desktop_dir = ephy_file_desktop_dir ();
+ downloads_dir = g_build_filename (desktop_dir, converted, NULL);
+
+ g_free (desktop_dir);
+ g_free (converted);
+
+ return downloads_dir;
+}
+
+char *
+ephy_file_desktop_dir (void)
+{
+ char *downloads_dir;
+ gboolean desktop_is_home;
+
desktop_is_home = eel_gconf_get_boolean (CONF_DESKTOP_IS_HOME_DIR);
if (desktop_is_home)
{
- downloads_dir = g_build_filename
- (g_get_home_dir (), converted, NULL);
+ downloads_dir = g_strdup (g_get_home_dir ());
}
else
{
downloads_dir = g_build_filename
- (g_get_home_dir (), "Desktop", converted, NULL);
+ (g_get_home_dir (), "Desktop", NULL);
}
- g_free (converted);
-
return downloads_dir;
}