summaryrefslogtreecommitdiffstats
path: root/src/tools/qtpaths/qtpaths.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/qtpaths/qtpaths.cpp')
-rw-r--r--src/tools/qtpaths/qtpaths.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/tools/qtpaths/qtpaths.cpp b/src/tools/qtpaths/qtpaths.cpp
index b4e2d749aa..71f9fe4349 100644
--- a/src/tools/qtpaths/qtpaths.cpp
+++ b/src/tools/qtpaths/qtpaths.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2016 Sune Vuorela <sune@kde.org>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <QCoreApplication>
#include <QCommandLineParser>
@@ -61,9 +61,6 @@ static const StringEnum lookupTableData[] = {
{ "ApplicationsLocation", QStandardPaths::ApplicationsLocation, false },
{ "CacheLocation", QStandardPaths::CacheLocation, true },
{ "ConfigLocation", QStandardPaths::ConfigLocation, false },
-#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
- { "DataLocation", QStandardPaths::DataLocation, true },
-#endif
{ "DesktopLocation", QStandardPaths::DesktopLocation, false },
{ "DocumentsLocation", QStandardPaths::DocumentsLocation, false },
{ "DownloadLocation", QStandardPaths::DownloadLocation, false },
@@ -71,12 +68,14 @@ static const StringEnum lookupTableData[] = {
{ "GenericCacheLocation", QStandardPaths::GenericCacheLocation, false },
{ "GenericConfigLocation", QStandardPaths::GenericConfigLocation, false },
{ "GenericDataLocation", QStandardPaths::GenericDataLocation, false },
+ { "GenericStateLocation", QStandardPaths::GenericStateLocation, false },
{ "HomeLocation", QStandardPaths::HomeLocation, false },
{ "MoviesLocation", QStandardPaths::MoviesLocation, false },
{ "MusicLocation", QStandardPaths::MusicLocation, false },
{ "PicturesLocation", QStandardPaths::PicturesLocation, false },
{ "PublicShareLocation", QStandardPaths::PublicShareLocation, false },
{ "RuntimeLocation", QStandardPaths::RuntimeLocation, false },
+ { "StateLocation", QStandardPaths::StateLocation, true },
{ "TemplatesLocation", QStandardPaths::TemplatesLocation, false },
{ "TempLocation", QStandardPaths::TempLocation, false }
};
@@ -222,13 +221,13 @@ int main(int argc, char **argv)
#if QT_CONFIG(settings)
if (parser.isSet(qtconf)) {
qtconfManualPath = parser.value(qtconf);
- QLibraryInfoPrivate::qtconfManualPath = &qtconfManualPath;
+ QLibraryInfoPrivate::setQtconfManualPath(&qtconfManualPath);
}
#endif
QStringList results;
if (parser.isSet(qtversion)) {
- QString qtversionstring = QString::fromLatin1(qVersion());
+ QString qtversionstring = QString::fromLatin1(QT_VERSION_STR);
results << qtversionstring;
}
@@ -252,6 +251,10 @@ int main(int argc, char **argv)
results << typesList.join('\n');
}
+ QT_WARNING_PUSH
+#if defined(Q_CC_GNU_ONLY) && Q_CC_GNU >= 1300 && Q_CC_GNU < 1500
+ QT_WARNING_DISABLE_GCC("-Wdangling-reference")
+#endif
if (parser.isSet(display)) {
const StringEnum &location = parseLocationOrError(parser.value(display));
QString text = QStandardPaths::displayName(location.enumvalue);
@@ -303,6 +306,7 @@ int main(int argc, char **argv)
QStringList paths = QStandardPaths::locateAll(location.enumvalue, searchitem, QStandardPaths::LocateFile);
results << location.mapName(paths.join(pathsep));
}
+ QT_WARNING_POP
#if !QT_CONFIG(settings)
if (parser.isSet(query) || parser.isSet(qtconf) || parser.isSet(queryformat)) {
@@ -340,7 +344,7 @@ int main(int argc, char **argv)
if (results.isEmpty()) {
parser.showHelp();
} else if (results.size() == 1) {
- const QString &item = results.first();
+ const QString &item = results.constFirst();
message(item);
if (item.isEmpty())
return EXIT_FAILURE;