From 32e0da45012cfe84250a8617544972f6c4c29447 Mon Sep 17 00:00:00 2001 From: Hannah von Reth Date: Mon, 19 Jun 2017 11:52:58 +0200 Subject: Add "/data/" to the non Generic paths on Windows was initially thought to be app-specific but is in fact more used as a kind of vendor prefix, where one vendor (e.g. KDE) can install many applications into the same APPDIR. [ChangeLog][QtCore][QStandardPaths] On Windows, QStandardPaths now also looks into "/data/" for non-generic paths. Change-Id: I426d97d61cc229bad0f5a2a4eb061e349de6681e Reviewed-by: David Faure --- src/corelib/io/qstandardpaths.cpp | 6 +++--- src/corelib/io/qstandardpaths_win.cpp | 10 +++++++++- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/io/qstandardpaths.cpp b/src/corelib/io/qstandardpaths.cpp index f2368c3b23..c3d45caf0e 100644 --- a/src/corelib/io/qstandardpaths.cpp +++ b/src/corelib/io/qstandardpaths.cpp @@ -183,7 +183,7 @@ QT_BEGIN_NAMESPACE \li "C:/Users/" \row \li DataLocation \li "~/Library/Application Support/", "/Library/Application Support/". "/../Resources" - \li "C:/Users//AppData/Local/", "C:/ProgramData/", "", "/data" + \li "C:/Users//AppData/Local/", "C:/ProgramData/", "", "/data", "/data/" \row \li CacheLocation \li "~/Library/Caches/", "/Library/Caches/" \li "C:/Users//AppData/Local//cache" @@ -207,10 +207,10 @@ QT_BEGIN_NAMESPACE \li "C:/Users//AppData/Local/cache" \row \li AppDataLocation \li "~/Library/Application Support/", "/Library/Application Support/". "/../Resources" - \li "C:/Users//AppData/Roaming/", "C:/ProgramData/", "", "/data" + \li "C:/Users//AppData/Roaming/", "C:/ProgramData/", "", "/data", "/data/" \row \li AppLocalDataLocation \li "~/Library/Application Support/", "/Library/Application Support/". "/../Resources" - \li "C:/Users//AppData/Local/", "C:/ProgramData/", "", "/data" + \li "C:/Users//AppData/Local/", "C:/ProgramData/", "", "/data", "/data/" \row \li AppConfigLocation \li "~/Library/Preferences/" \li "C:/Users//AppData/Local/", "C:/ProgramData/" diff --git a/src/corelib/io/qstandardpaths_win.cpp b/src/corelib/io/qstandardpaths_win.cpp index a64bde6fb4..41fd31df8b 100644 --- a/src/corelib/io/qstandardpaths_win.cpp +++ b/src/corelib/io/qstandardpaths_win.cpp @@ -218,7 +218,15 @@ QStringList QStandardPaths::standardLocations(StandardLocation type) } #ifndef QT_BOOTSTRAPPED dirs.append(QCoreApplication::applicationDirPath()); - dirs.append(QCoreApplication::applicationDirPath() + QLatin1String("/data")); + const QString dataDir = QCoreApplication::applicationDirPath() + QLatin1String("/data"); + dirs.append(dataDir); + + if (!isGenericConfigLocation(type)) { + QString appDataDir = dataDir; + appendOrganizationAndApp(appDataDir); + if (appDataDir != dataDir) + dirs.append(appDataDir); + } #endif // !QT_BOOTSTRAPPED } // isConfigLocation() -- cgit v1.2.3