From 301c5a1e597e71990adafdc5ae1efbb1ec21bb2b Mon Sep 17 00:00:00 2001 From: "wr%rosenauer.org" Date: Wed, 1 Feb 2006 16:19:24 +0000 Subject: [PATCH] Bug 300856 - Cannot set default download directory to home on Linux/Unix, r=mconnor --- browser/components/preferences/downloads.js | 22 ++++++++++--------- mail/components/preferences/downloads.js | 19 ++++++++++------ .../mozapps/downloads/content/downloads.js | 20 +++++++++-------- 3 files changed, 35 insertions(+), 26 deletions(-) diff --git a/browser/components/preferences/downloads.js b/browser/components/preferences/downloads.js index 7ce6b64e80c9..4004a3e7554d 100644 --- a/browser/components/preferences/downloads.js +++ b/browser/components/preferences/downloads.js @@ -94,19 +94,21 @@ var gDownloadsPane = { _getSpecialFolderKey: function (aFolderType) { + if (aFolderType == "Desktop") + return "Desk"; + + if (aFolderType != "Downloads") + throw "ASSERTION FAILED: folder type should be 'Desktop' or 'Downloads'"; + #ifdef XP_WIN - return aFolderType == "Desktop" ? "DeskP" : "Pers"; -#endif + return "Pers"; +#else #ifdef XP_MACOSX - return aFolderType == "Desktop" ? "UsrDsk" : "UsrDocs"; -#endif -#ifdef XP_OS2 - return aFolderType == "Desktop" ? "Desk" : "Home"; -#endif -#ifdef XP_BEOS - return aFolderType == "Desktop" ? "Desk" : "Home"; -#endif + return "UsrDocs"; +#else return "Home"; +#endif +#endif }, _getDownloadsFolder: function (aFolder) diff --git a/mail/components/preferences/downloads.js b/mail/components/preferences/downloads.js index f033e75bac6a..7906be1ab2d2 100644 --- a/mail/components/preferences/downloads.js +++ b/mail/components/preferences/downloads.js @@ -94,16 +94,21 @@ var gDownloadsPane = { _getSpecialFolderKey: function (aFolderType) { + if (aFolderType == "Desktop") + return "Desk"; + + if (aFolderType != "Downloads") + throw "ASSERTION FAILED: folder type should be 'Desktop' or 'Downloads'"; + #ifdef XP_WIN - return aFolderType == "Desktop" ? "DeskP" : "Pers"; -#endif + return "Pers"; +#else #ifdef XP_MACOSX - return aFolderType == "Desktop" ? "UsrDsk" : "UsrDocs"; -#endif -#ifdef XP_OS2 - return aFolderType == "Desktop" ? "Desk" : "Home"; -#endif + return "UsrDocs"; +#else return "Home"; +#endif +#endif }, _getDownloadsFolder: function (aFolder) diff --git a/toolkit/mozapps/downloads/content/downloads.js b/toolkit/mozapps/downloads/content/downloads.js index b7bbd744105a..96474ffd3612 100644 --- a/toolkit/mozapps/downloads/content/downloads.js +++ b/toolkit/mozapps/downloads/content/downloads.js @@ -778,19 +778,21 @@ function initAutoDownloadDisplay() function getSpecialFolderKey(aFolderType) { + if (aFolderType == "Desktop") + return "Desk"; + + if (aFolderType != "Downloads") + throw "ASSERTION FAILED: folder type should be 'Desktop' or 'Downloads'"; + #ifdef XP_WIN - return aFolderType == "Desktop" ? "DeskP" : "Pers"; -#endif + return "Pers"; +#else #ifdef XP_MACOSX - return aFolderType == "Desktop" ? "UsrDsk" : "UsrDocs"; + return "UsrDocs"; +#else + return "Home"; #endif -#ifdef XP_OS2 - return aFolderType == "Desktop" ? "Desk" : "Home"; #endif -#ifdef XP_BEOS - return aFolderType == "Desktop" ? "Desk" : "Home"; -#endif - return "Home"; } function getDownloadsFolder(aFolder)