diff options
author | Alexey Edelev <alexey.edelev@qt.io> | 2023-02-08 14:15:32 +0100 |
---|---|---|
committer | Alexey Edelev <alexey.edelev@qt.io> | 2023-02-08 20:30:15 +0100 |
commit | d83b399d412375a0878b8023b8ea6fc115e98c70 (patch) | |
tree | d2757f66b4e6ed858cef3644f0ff1fbc39aefe82 | |
parent | cfd461d438d40cc55e8085b79d0e4b2c03371e46 (diff) |
Revert "Add listing of the components and scripts that belongs to the qml module"
This reverts commit 2cc85e60d4313bd845bfdc233e5e75a8b7ccb01f.
Reason for revert: This breaks Quick style plugin loading QTBUG-110433
Task-number: QTBUG-36637
Task-number: QTBUG-97834
Task-number: QTBUG-110433
Change-Id: If1aa6b6019a2db7652fa6b9fbe034fd1ef66a492
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r-- | tools/qmlimportscanner/main.cpp | 66 |
1 files changed, 12 insertions, 54 deletions
diff --git a/tools/qmlimportscanner/main.cpp b/tools/qmlimportscanner/main.cpp index 52eebcdf65..9f6a89810f 100644 --- a/tools/qmlimportscanner/main.cpp +++ b/tools/qmlimportscanner/main.cpp @@ -71,14 +71,6 @@ inline QString dependenciesLiteral() { return QStringLiteral("dependencies"); } inline QString moduleLiteral() { return QStringLiteral("module"); } inline QString javascriptLiteral() { return QStringLiteral("javascript"); } inline QString directoryLiteral() { return QStringLiteral("directory"); } -inline QString componentsLiteral() -{ - return QStringLiteral("components"); -} -inline QString scriptsLiteral() -{ - return QStringLiteral("scripts"); -} void printUsage(const QString &appNameIn) { @@ -158,42 +150,21 @@ QVariantMap pluginsForModulePath(const QString &modulePath) { QString plugins; QString classnames; QStringList dependencies; - QStringList componentFiles; - QStringList scriptFiles; QByteArray line; do { line = qmldirFile.readLine(); - const QList<QByteArray> sections = line.split(' '); - if (sections.size() > 0) { - const QByteArray §ionType = sections.at(0); - if (sectionType == "plugin") { - plugins += QString::fromUtf8(line.split(' ').at(1)); - plugins += QLatin1Char(' '); - } else if (sectionType == "classname") { - classnames += QString::fromUtf8(line.split(' ').at(1)); - classnames += QLatin1Char(' '); - } else if (sectionType == "depends") { - if (sections.size() != 3) - std::cerr << "depends: expected 2 arguments: module identifier and version" - << std::endl; - else - dependencies << QString::fromUtf8(sections.at(1)) + QLatin1Char(' ') - + QString::fromUtf8(sections.at(2)).simplified(); - } else if (sections.size() == 2 && sectionType != "module" - && sectionType != "typeinfo") { - componentFiles.append(modulePath + QLatin1Char('/') - + QString::fromUtf8(sections.at(1))); - } else if (sections.size() == 3 - || (sectionType == "singleton" && sections.size() == 4)) { - int fileNameIndex = (sectionType == "singleton") ? 3 : 2; - const QString fileName = QString::fromUtf8(sections.at(fileNameIndex)); - const QString filePath = modulePath + QLatin1Char('/') + fileName; - if (fileName.endsWith(QLatin1String(".js")) - || fileName.endsWith(QLatin1String(".mjs"))) - scriptFiles.append(filePath); - else - componentFiles.append(filePath); - } + if (line.startsWith("plugin")) { + plugins += QString::fromUtf8(line.split(' ').at(1)); + plugins += QLatin1Char(' '); + } else if (line.startsWith("classname")) { + classnames += QString::fromUtf8(line.split(' ').at(1)); + classnames += QLatin1Char(' '); + } else if (line.startsWith("depends")) { + const QList<QByteArray> dep = line.split(' '); + if (dep.length() != 3) + std::cerr << "depends: expected 2 arguments: module identifier and version" << std::endl; + else + dependencies << QString::fromUtf8(dep[1]) + QLatin1Char(' ') + QString::fromUtf8(dep[2]).simplified(); } } while (line.length() > 0); @@ -202,12 +173,7 @@ QVariantMap pluginsForModulePath(const QString &modulePath) { pluginInfo[pluginsLiteral()] = plugins.simplified(); pluginInfo[classnamesLiteral()] = classnames.simplified(); if (dependencies.length()) - dependencies.removeDuplicates(); pluginInfo[dependenciesLiteral()] = dependencies; - if (!componentFiles.isEmpty()) - pluginInfo[componentsLiteral()] = componentFiles; - if (!scriptFiles.isEmpty()) - pluginInfo[scriptsLiteral()] = scriptFiles; return pluginInfo; } @@ -281,8 +247,6 @@ QVariantList findPathsForModuleImports(const QVariantList &imports) QVariantMap plugininfo = pluginsForModulePath(import.value(pathLiteral()).toString()); QString plugins = plugininfo.value(pluginsLiteral()).toString(); QString classnames = plugininfo.value(classnamesLiteral()).toString(); - QStringList components = plugininfo.value(componentsLiteral()).toStringList(); - QStringList scripts = plugininfo.value(scriptsLiteral()).toStringList(); if (!plugins.isEmpty()) import.insert(QStringLiteral("plugin"), plugins); if (!classnames.isEmpty()) @@ -298,12 +262,6 @@ QVariantList findPathsForModuleImports(const QVariantList &imports) importsCopy.append(depImport); } } - if (!components.isEmpty()) { - import.insert(componentsLiteral(), components); - } - if (!scripts.isEmpty()) { - import.insert(scriptsLiteral(), scripts); - } } done.append(import); } |