aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qmldirparser/qqmldirparser.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-06-30 15:25:51 +0200
committerUlf Hermann <ulf.hermann@qt.io>2020-07-08 09:46:46 +0200
commit6aa4c83bdbd9a8df05c14ac1aaad2f1d44053ec4 (patch)
tree8186599d1366b3bfbb7e65ab3d5a129e903a4c37 /src/qml/qmldirparser/qqmldirparser.cpp
parente52e7ad76edc6012285db6c83eb12e8724a234ac (diff)
qmlimportscanner: Use QmlDirParser
This gives us a reliable way to parse imports and versions. Apparently we can also have multiple classname entries in the same qmldir file. Reflect that in the parser. Also, drop the version field from the output. Nobody uses it and maintaining it while allowing partial, missing and auto versions would be rather difficult. Fixes: QTBUG-85304 Change-Id: Iab89a6d505a3c58174e623f02f0418899cb5fa2f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/qmldirparser/qqmldirparser.cpp')
-rw-r--r--src/qml/qmldirparser/qqmldirparser.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/qml/qmldirparser/qqmldirparser.cpp b/src/qml/qmldirparser/qqmldirparser.cpp
index c8589431b8..e774f471cb 100644
--- a/src/qml/qmldirparser/qqmldirparser.cpp
+++ b/src/qml/qmldirparser/qqmldirparser.cpp
@@ -84,7 +84,7 @@ void QQmlDirParser::clear()
_plugins.clear();
_designerSupported = false;
_typeInfos.clear();
- _className.clear();
+ _classNames.clear();
}
inline static void scanSpace(const QChar *&ch) {
@@ -212,7 +212,7 @@ bool QQmlDirParser::parse(const QString &source)
continue;
}
- _className = sections[1];
+ _classNames.append(sections[1]);
} else if (sections[0] == QLatin1String("internal")) {
if (sectionCount != 3) {
@@ -410,9 +410,9 @@ bool QQmlDirParser::designerSupported() const
return _designerSupported;
}
-QString QQmlDirParser::className() const
+QStringList QQmlDirParser::classNames() const
{
- return _className;
+ return _classNames;
}
QDebug &operator<< (QDebug &debug, const QQmlDirParser::Component &component)