aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmllint/checkidentifiers.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-10-14 12:55:08 +0200
committerUlf Hermann <ulf.hermann@qt.io>2020-10-15 10:44:20 +0200
commitf98c961da6d039621ae40ab6c1a79c4b06efb83f (patch)
tree0eca1d6c2e19e54795da143ecb65279acd972572 /tools/qmllint/checkidentifiers.cpp
parented9ffa109eb2f242b59443ad430204a90c8028c4 (diff)
qmllint: Defer resolution of types read from QML files
When importing a directory we most likely don't need all of the files in the directory. Therefore we now parse them only when they are accessed. This speeds up the execution and will allow us to process imports recursively without running into infinite recursion. Change-Id: I0c79313de792249e6bb86144b5014a7787dbdc5b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tools/qmllint/checkidentifiers.cpp')
-rw-r--r--tools/qmllint/checkidentifiers.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/qmllint/checkidentifiers.cpp b/tools/qmllint/checkidentifiers.cpp
index 6fa26b86ba..b7d331521c 100644
--- a/tools/qmllint/checkidentifiers.cpp
+++ b/tools/qmllint/checkidentifiers.cpp
@@ -82,7 +82,7 @@ void CheckIdentifiers::printContext(
static bool walkViaParentAndAttachedScopes(QQmlJSScope::ConstPtr rootType,
std::function<bool(QQmlJSScope::ConstPtr)> visit)
{
- if (rootType == nullptr)
+ if (rootType.isNull())
return false;
std::stack<QQmlJSScope::ConstPtr> stack;
stack.push(rootType);
@@ -186,7 +186,7 @@ bool CheckIdentifiers::checkMemberAccess(const QVector<FieldMember> &members,
if (it == m_types.end()) {
detectedRestrictiveKind = typeName;
detectedRestrictiveName = access.m_name;
- scope = nullptr;
+ scope = QQmlJSScope::ConstPtr();
} else {
scope = *it;
}
@@ -304,7 +304,7 @@ bool CheckIdentifiers::operator()(
auto it = qmlIDs.find(memberAccessBase.m_name);
if (it != qmlIDs.end()) {
- if (*it != nullptr) {
+ if (!it->isNull()) {
if (!checkMemberAccess(memberAccessChain, *it))
noUnqualifiedIdentifier = false;
continue;