summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuhang Zhao <2546789017@qq.com>2022-01-05 17:13:31 +0800
committerYuhang Zhao <2546789017@qq.com>2022-01-13 20:13:49 +0800
commitc1f7194b44a2186f723c85e215e57dfa677538c0 (patch)
treef89e6b0247d1a7c07f4f4da3d30d07e85aca1e49
parent54945d58b3900767522f2625b3ec6a126b7401b3 (diff)
QStandardPaths_win: Add mapping for DownloadLocation
Un-special-case for DownloadLocation. I assume the original code is written like that to be compatible with some really old versions of Windows. Change-Id: I643401910bae9a061f2e02c651971b4f2dd46901 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
-rw-r--r--src/corelib/io/qstandardpaths_win.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/corelib/io/qstandardpaths_win.cpp b/src/corelib/io/qstandardpaths_win.cpp
index 0d24ed3ce9..2ddf4a5fe1 100644
--- a/src/corelib/io/qstandardpaths_win.cpp
+++ b/src/corelib/io/qstandardpaths_win.cpp
@@ -130,7 +130,8 @@ static GUID writableSpecialFolderId(QStandardPaths::StandardLocation type)
FOLDERID_LocalAppData, // GenericDataLocation ("Local" path)
GUID(), // RuntimeLocation
FOLDERID_LocalAppData, // ConfigLocation ("Local" path)
- GUID(), GUID(), // DownloadLocation/GenericCacheLocation
+ FOLDERID_Downloads, // DownloadLocation
+ GUID(), // GenericCacheLocation
FOLDERID_LocalAppData, // GenericConfigLocation ("Local" path)
FOLDERID_RoamingAppData,// AppDataLocation ("Roaming" path)
FOLDERID_LocalAppData, // AppConfigLocation ("Local" path)
@@ -154,7 +155,8 @@ static GUID writableSpecialFolderId(QStandardPaths::StandardLocation type)
FOLDERID_LocalAppDataLow,// GenericDataLocation ("Local" path)
GUID(), // RuntimeLocation
FOLDERID_LocalAppDataLow,// ConfigLocation ("Local" path)
- GUID(), GUID(), // DownloadLocation/GenericCacheLocation
+ FOLDERID_Downloads, // DownloadLocation
+ GUID(), // GenericCacheLocation
FOLDERID_LocalAppDataLow,// GenericConfigLocation ("Local" path)
FOLDERID_RoamingAppData, // AppDataLocation ("Roaming" path)
FOLDERID_LocalAppDataLow,// AppConfigLocation ("Local" path)
@@ -185,12 +187,6 @@ QString QStandardPaths::writableLocation(StandardLocation type)
{
QString result;
switch (type) {
- case DownloadLocation:
- result = sHGetKnownFolderPath(FOLDERID_Downloads);
- if (result.isEmpty())
- result = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
- break;
-
case CacheLocation:
// Although Microsoft has a Cache key it is a pointer to IE's cache, not a cache
// location for everyone. Most applications seem to be using a