mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 399498 - "use XDG downloads dir as default downloads dir" (use XDG download dir, with a fallback to the current default if the XDG user dirs are disabled) [p=chpe@gnome.org (Christian Persch) r=sdwilsh r=bsmedberg a1.9=damons]
This commit is contained in:
parent
315b9859b3
commit
2c1bf0f84c
@ -1123,7 +1123,7 @@ nsDownloadManager::GetDefaultDownloadsDirectory(nsILocalFile **aResult)
|
||||
// XP/2K:
|
||||
// Desktop/Downloads
|
||||
// Linux:
|
||||
// Home/Downloads
|
||||
// XDG user dir spec, with a fallback to Home/Downloads
|
||||
|
||||
nsXPIDLString folderName;
|
||||
mBundle->GetStringFromName(NS_LITERAL_STRING("downloadsFolder").get(),
|
||||
@ -1167,6 +1167,19 @@ nsDownloadManager::GetDefaultDownloadsDirectory(nsILocalFile **aResult)
|
||||
rv = downloadDir->Append(folderName);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
#elif defined(XP_UNIX)
|
||||
rv = dirService->Get(NS_UNIX_DEFAULT_DOWNLOAD_DIR,
|
||||
NS_GET_IID(nsILocalFile),
|
||||
getter_AddRefs(downloadDir));
|
||||
// fallback to Home/Downloads
|
||||
if (NS_FAILED(rv)) {
|
||||
rv = dirService->Get(NS_UNIX_HOME_DIR,
|
||||
NS_GET_IID(nsILocalFile),
|
||||
getter_AddRefs(downloadDir));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
rv = downloadDir->Append(folderName);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
#else
|
||||
rv = dirService->Get(NS_OS_HOME_DIR,
|
||||
NS_GET_IID(nsILocalFile),
|
||||
|
@ -194,6 +194,7 @@
|
||||
#define NS_UNIX_XDG_PUBLIC_SHARE_DIR "XDGPubSh"
|
||||
#define NS_UNIX_XDG_TEMPLATES_DIR "XDGTempl"
|
||||
#define NS_UNIX_XDG_VIDEOS_DIR "XDGVids"
|
||||
#define NS_UNIX_DEFAULT_DOWNLOAD_DIR "DfltDwnld"
|
||||
#elif defined (XP_OS2)
|
||||
#define NS_OS2_DIR "OS2Dir"
|
||||
#define NS_OS2_HOME_DIR NS_OS_HOME_DIR
|
||||
|
Loading…
Reference in New Issue
Block a user