Bug 568373 - Use "Desktop" for Windows, because apparently we don't have a useful notion of "Home" on Windows

This commit is contained in:
Ehsan Akhgari 2010-05-30 21:50:11 -04:00
Родитель 6d1cdd8d9b
Коммит b27cf250ee
2 изменённых файлов: 11 добавлений и 2 удалений

Просмотреть файл

@ -421,7 +421,12 @@ nsFileControlFrame::MouseListener::MouseClick(nsIDOMEvent* aMouseEvent)
if (!localFile) {
// Default to "home" directory for each platform
nsCOMPtr<nsIFile> homeDir;
NS_GetSpecialDirectory(NS_OS_HOME_DIR, getter_AddRefs(homeDir));
#ifdef XP_WIN
const char *dir = NS_WIN_DESKTOP_DIRECTORY; // Use Desktop on Windows
#else
const char *dir = NS_OS_HOME_DIR;
#endif
NS_GetSpecialDirectory(dir, getter_AddRefs(homeDir));
localFile = do_QueryInterface(homeDir);
}
filePicker->SetDisplayDirectory(localFile);

Просмотреть файл

@ -34,7 +34,11 @@ if ("@mozilla.org/privatebrowsing;1" in Cc) {
}
var tmpDir = dirSvc.get("TmpD", Ci.nsILocalFile);
var homeDir = dirSvc.get("Home", Ci.nsILocalFile);
var homeDirName = "Home";
const isWindows = ("@mozilla.org/windows-registry-key;1" in Cc);
if (isWindows)
homeDirName = "DeskP";
var homeDir = dirSvc.get(, Ci.nsILocalFile);
prefSvc.setBoolPref("browser.privatebrowsing.keep_current_session", true);
function newDir() {