diff --git a/browser/components/preferences/main.js b/browser/components/preferences/main.js index 7ba6e91cb20..8c5b087f423 100644 --- a/browser/components/preferences/main.js +++ b/browser/components/preferences/main.js @@ -198,8 +198,8 @@ var gMainPane = { * browser.download.dir. * browser.download.downloadDir * depreciated. - * browser.download.defaultFolder - * depreciated. + * browser.download.defaultFolder + * depreciated. */ /** @@ -298,17 +298,17 @@ var gMainPane = { var downloadFolder = document.getElementById("downloadFolder"); var currentDirPref = document.getElementById("browser.download.dir"); - // The user's download folder is based on the preferences listed above. - // However, if the system does not support a download folder, the - // actual path returned will be the system's desktop or home folder. - // If this is the case, skip off displaying the Download label and - // display Desktop, even though folderList might be 1. - var fileLocator = Components.classes["@mozilla.org/file/directory_service;1"] - .getService(Components.interfaces.nsIProperties); - var desk = fileLocator.get("Desk", Components.interfaces.nsILocalFile); - var dnldMgr = Components.classes["@mozilla.org/download-manager;1"] - .getService(Components.interfaces.nsIDownloadManager); - var supportDownloadLabel = !dnldMgr.defaultDownloadsDirectory.equals(desk); + // The user's download folder is based on the preferences listed above. + // However, if the system does not support a download folder, the + // actual path returned will be the system's desktop or home folder. + // If this is the case, skip off displaying the Download label and + // display Desktop, even though folderList might be 1. + var fileLocator = Components.classes["@mozilla.org/file/directory_service;1"] + .getService(Components.interfaces.nsIProperties); + var desk = fileLocator.get("Desk", Components.interfaces.nsILocalFile); + var dnldMgr = Components.classes["@mozilla.org/download-manager;1"] + .getService(Components.interfaces.nsIDownloadManager); + var supportDownloadLabel = !dnldMgr.defaultDownloadsDirectory.equals(desk); // Used in defining the correct path to the folder icon. var ios = Components.classes["@mozilla.org/network/io-service;1"] diff --git a/toolkit/content/contentAreaUtils.js b/toolkit/content/contentAreaUtils.js index d767f97e257..7d6ef5bb14b 100644 --- a/toolkit/content/contentAreaUtils.js +++ b/toolkit/content/contentAreaUtils.js @@ -455,8 +455,8 @@ function getTargetFile(aFpP, aSkipPrompt) // mozilla/browser/components/preferences/main.js var useDownloadDir = prefs.getBoolPref("useDownloadDir"); - var dir = null; - + var dir = null; + try { // On prompt operations, default to lastDir, on direct to folder // downloads, default to the user's configured download folder. @@ -471,7 +471,7 @@ function getTargetFile(aFpP, aSkipPrompt) } } catch (ex) { } - + if (!aSkipPrompt || !useDownloadDir || !dir || (dir && !dir.exists())) { // If we're asking the user where to save the file, root the Save As... // dialog on the place they last picked. diff --git a/toolkit/mozapps/downloads/src/nsHelperAppDlg.js.in b/toolkit/mozapps/downloads/src/nsHelperAppDlg.js.in index f4c18066ad8..e60bf2a1f4d 100644 --- a/toolkit/mozapps/downloads/src/nsHelperAppDlg.js.in +++ b/toolkit/mozapps/downloads/src/nsHelperAppDlg.js.in @@ -142,7 +142,7 @@ nsUnknownContentTypeDialog.prototype = { var autodownload = prefs.getBoolPref("browser.download.useDownloadDir"); if (autodownload) { - // Retrieve the user's default download directory + // Retrieve the user's default download directory var dnldMgr = Components.classes["@mozilla.org/download-manager;1"] .getService(Components.interfaces.nsIDownloadManager); var defaultFolder = dnldMgr.userDownloadsDirectory;