diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2004-10-02 22:25:00 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2004-10-02 22:25:00 +0800 |
commit | 5d5a8b49ca1742cc34161ba73287540f779795a5 (patch) | |
tree | fcccf2693cdf8ca82c44003184d5fc9f1f624e6e | |
parent | 59c38b2fabd382321fbcf1e4a8db70c8c59016ec (diff) | |
download | gsoc2013-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.
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | embed/mozilla/MozDownload.cpp | 5 | ||||
-rw-r--r-- | lib/ephy-file-helpers.c | 25 | ||||
-rw-r--r-- | lib/ephy-file-helpers.h | 2 | ||||
-rw-r--r-- | src/prefs-dialog.c | 4 |
5 files changed, 39 insertions, 7 deletions
@@ -1,5 +1,15 @@ 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. + +2004-10-02 Christian Persch <chpe@cvs.gnome.org> + * Makefile.am: Add --with-mozilla to distcheck's configure arguments. diff --git a/embed/mozilla/MozDownload.cpp b/embed/mozilla/MozDownload.cpp index c615f8be1..a70daf0c8 100644 --- a/embed/mozilla/MozDownload.cpp +++ b/embed/mozilla/MozDownload.cpp @@ -600,6 +600,11 @@ GetFilePath (const char *filename) g_free (download_dir); download_dir = ephy_file_downloads_dir (); } + else if (download_dir && strcmp (download_dir, "Desktop") == 0) + { + g_free (download_dir); + download_dir = ephy_file_desktop_dir (); + } else if (download_dir) { char *converted_dp; 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; } diff --git a/lib/ephy-file-helpers.h b/lib/ephy-file-helpers.h index bfb7e1b6c..6beb2951a 100644 --- a/lib/ephy-file-helpers.h +++ b/lib/ephy-file-helpers.h @@ -35,6 +35,8 @@ void ephy_file_helpers_shutdown (void); char *ephy_file_downloads_dir (void); +char *ephy_file_desktop_dir (void); + const char *ephy_file_tmp_dir (void); char *ephy_file_tmp_filename (const char *base, diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c index 35155f4e9..abd0d7da6 100644 --- a/src/prefs-dialog.c +++ b/src/prefs-dialog.c @@ -1112,6 +1112,10 @@ get_download_button_label () { label = g_strdup (_("Desktop")); } + else if (g_utf8_collate (key, "Desktop") == 0) + { + label = g_strdup (_("Desktop")); + } else { label = g_strdup (key); |