diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2016-03-17 09:48:08 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2016-03-17 09:13:05 +0000 |
commit | aa3008dfa1e3dfa0f6a35999ae62e4c012ad8089 (patch) | |
tree | 8d5aafd5c7852e5dce37b4688b263ffa19ef22f4 /src/corelib/io/qstandardpaths_win.cpp | |
parent | 09acf326dbc6b7b67f21a360be8c91605ce47f1e (diff) |
Introduce separate mapping of QStandardPaths's CLSIDs for Windows CE.
CSIDL_APPDATA should be used instead of CSIDL_LOCAL_APPDATA
on Windows CE. Amends 910f719bd111813f37278b67d07f9d12cb03a4ff .
Task-number: QTBUG-50570
Change-Id: I0cc310ef5fe3fbaefae9c84dd9db8cf48ff48499
Reviewed-by: Tobias Koenig <tobias.koenig@kdab.com>
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Diffstat (limited to 'src/corelib/io/qstandardpaths_win.cpp')
-rw-r--r-- | src/corelib/io/qstandardpaths_win.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/corelib/io/qstandardpaths_win.cpp b/src/corelib/io/qstandardpaths_win.cpp index 73d49cbc25..c1b34d1341 100644 --- a/src/corelib/io/qstandardpaths_win.cpp +++ b/src/corelib/io/qstandardpaths_win.cpp @@ -111,6 +111,7 @@ static inline void appendTestMode(QString &path) // Map QStandardPaths::StandardLocation to CLSID of SHGetSpecialFolderPath() static int writableSpecialFolderClsid(QStandardPaths::StandardLocation type) { +#ifndef Q_OS_WINCE static const int clsids[] = { CSIDL_DESKTOPDIRECTORY, // DesktopLocation CSIDL_PERSONAL, // DocumentsLocation @@ -130,6 +131,27 @@ static int writableSpecialFolderClsid(QStandardPaths::StandardLocation type) CSIDL_APPDATA, // AppDataLocation ("Roaming" path) CSIDL_LOCAL_APPDATA, // AppConfigLocation ("Local" path) }; +#else // !Q_OS_WINCE + static const int clsids[] = { + CSIDL_DESKTOPDIRECTORY, // DesktopLocation + CSIDL_PERSONAL, // DocumentsLocation + CSIDL_FONTS, // FontsLocation + CSIDL_PROGRAMS, // ApplicationsLocation + CSIDL_MYMUSIC, // MusicLocation + CSIDL_MYVIDEO, // MoviesLocation + CSIDL_MYPICTURES, // PicturesLocation + -1, -1, // TempLocation/HomeLocation + CSIDL_APPDATA, // AppLocalDataLocation, AppLocalDataLocation = DataLocation + -1, // CacheLocation + CSIDL_APPDATA, // GenericDataLocation + -1, // RuntimeLocation + CSIDL_APPDATA, // ConfigLocation + -1, -1, // DownloadLocation/GenericCacheLocation + CSIDL_APPDATA, // GenericConfigLocation + CSIDL_APPDATA, // AppDataLocation + CSIDL_APPDATA, // AppConfigLocation + }; +#endif // Q_OS_WINCE Q_STATIC_ASSERT(sizeof(clsids) / sizeof(clsids[0]) == size_t(QStandardPaths::AppConfigLocation + 1)); return size_t(type) < sizeof(clsids) / sizeof(clsids[0]) ? clsids[type] : -1; |