diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2020-09-25 09:50:09 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-09-25 15:21:41 +0200 |
commit | 5a88c06665d5c0295691e216740210a5172fcc9e (patch) | |
tree | 76d61e5749420afd57f7a01939502fc593afd9f3 /tools/qmllint | |
parent | 88fd9c3996fd0280be639ad116ebc3a1b30ae0c4 (diff) |
qmllint: Clarify the meaning of the various names a scope can have
... and notice that they are misused everywhere.
Change-Id: I2254993dc5d11e967e7e83c6f0efb37fa17744be
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tools/qmllint')
-rw-r--r-- | tools/qmllint/checkidentifiers.cpp | 4 | ||||
-rw-r--r-- | tools/qmllint/findwarnings.cpp | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/tools/qmllint/checkidentifiers.cpp b/tools/qmllint/checkidentifiers.cpp index 6f28709a87..79a861b4c7 100644 --- a/tools/qmllint/checkidentifiers.cpp +++ b/tools/qmllint/checkidentifiers.cpp @@ -98,7 +98,7 @@ static bool walkViaParentAndAttachedScopes(ScopeTree::ConstPtr rootType, if (visit(type)) return true; - if (auto superType = allTypes.value(type->superclassName())) + if (auto superType = allTypes.value(type->baseTypeName())) stack.push(superType); if (auto attachedType = allTypes.value(type->attachedTypeName())) @@ -137,7 +137,7 @@ bool CheckIdentifiers::checkMemberAccess(const QVector<ScopeTree::FieldMember> & return false; } - const QString scopeName = scope->name().isEmpty() ? scope->className() : scope->name(); + const QString scopeName = scope->name().isEmpty() ? scope->internalName() : scope->name(); if (!detectedRestrictiveKind.isEmpty()) { if (expectedNext.contains(access.m_name)) { diff --git a/tools/qmllint/findwarnings.cpp b/tools/qmllint/findwarnings.cpp index 9686194c92..3877379a3b 100644 --- a/tools/qmllint/findwarnings.cpp +++ b/tools/qmllint/findwarnings.cpp @@ -156,7 +156,7 @@ void FindWarningVisitor::Importer::processImport( // add objects for (auto it = import.objects.begin(); it != import.objects.end(); ++it) { const auto &val = it.value(); - m_exportedName2Scope.insert(val->className(), val); + m_exportedName2Scope.insert(val->internalName(), val); const auto exports = val->exports(); for (const auto &valExport : exports) @@ -272,8 +272,8 @@ QHash<QString, ScopeTree::ConstPtr> FindWarningVisitor::Importer::importFileOrDi QDirIterator it { name, QStringList() << QLatin1String("*.qml"), QDir::NoFilter }; while (it.hasNext()) { ScopeTree::Ptr scope(localFile2ScopeTree(it.next())); - if (!scope->className().isEmpty()) - m_exportedName2Scope.insert(prefixedName(prefix, scope->className()), scope); + if (!scope->internalName().isEmpty()) + m_exportedName2Scope.insert(prefixedName(prefix, scope->internalName()), scope); } result.swap(m_exportedName2Scope); @@ -291,7 +291,7 @@ void FindWarningVisitor::importExportedNames(QStringView prefix, QString name) QString inheritenceCycle = name; for (const auto &seen: qAsConst(scopes)) { inheritenceCycle.append(QLatin1String(" -> ")); - inheritenceCycle.append(seen->superclassName()); + inheritenceCycle.append(seen->baseTypeName()); } @@ -314,7 +314,7 @@ void FindWarningVisitor::importExportedNames(QStringView prefix, QString name) } m_currentScope->addMethods(scope->methods()); - name = scope->superclassName(); + name = scope->baseTypeName(); if (name.isEmpty() || name == QLatin1String("QObject")) break; } else { |