aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qml/main.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2023-04-26 15:15:37 +0200
committerUlf Hermann <ulf.hermann@qt.io>2023-05-08 17:10:01 +0200
commitc6aa66b16364a0561ae28824ca39329ee9c4ede0 (patch)
treea721708e0d2217d7ceb0f75c0531d1b7f5ea87ad /tools/qml/main.cpp
parentbd6284d42da21bb3480cdbe0535495d4e4275e73 (diff)
qml: Straighten out configuration QML module
Use qt_add_qml_module correctly, apply a standard resource path, and move the files into the same directory as the module. Use upper case file names for the (re-usable) container definitions and lower case file names for the configuration entry points. This way we only need one directory and therefore only one QML module. Change-Id: Ic45dd0e8866f8f62bbaa639b6f138e9a75e05863 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'tools/qml/main.cpp')
-rw-r--r--tools/qml/main.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp
index 4e051f82c5..9ea69b272d 100644
--- a/tools/qml/main.cpp
+++ b/tools/qml/main.cpp
@@ -73,8 +73,8 @@ static QQmlApplicationEngine *qae = nullptr;
#if defined(Q_OS_DARWIN) || defined(QT_GUI_LIB)
static int exitTimerId = -1;
#endif
-static const QString iconResourcePath(QStringLiteral(":/qt-project.org/QmlRuntime/resources/qml-64.png"));
-static const QString confResourcePath(QStringLiteral(":/qt-project.org/QmlRuntime/conf/"));
+static const QString iconResourcePath(QStringLiteral(":/qt-project.org/imports/QmlRuntime/Config/resources/qml-64.png"));
+static const QString confResourcePath(QStringLiteral(":/qt-project.org/imports/QmlRuntime/Config/"));
static const QString customConfFileName(QStringLiteral("configuration.qml"));
static bool verboseMode = false;
static bool quietMode = false;
@@ -156,8 +156,16 @@ static void listConfFiles()
{
const QDir confResourceDir(confResourcePath);
printf("%s\n", qPrintable(QCoreApplication::translate("main", "Built-in configurations:")));
- for (const QFileInfo &fi : confResourceDir.entryInfoList(QDir::Files))
- printf(" %s\n", qPrintable(fi.baseName()));
+ for (const QFileInfo &fi : confResourceDir.entryInfoList(QDir::Files)) {
+ if (fi.completeSuffix() != QLatin1String("qml"))
+ continue;
+
+ const QString baseName = fi.baseName();
+ if (baseName.isEmpty() || baseName[0].isUpper())
+ continue;
+
+ printf(" %s\n", qPrintable(baseName));
+ }
printf("%s\n", qPrintable(QCoreApplication::translate("main", "Other configurations:")));
bool foundOther = false;
const QStringList otherLocations = QStandardPaths::standardLocations(QStandardPaths::AppConfigLocation);