diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2020-09-29 17:02:37 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-10-02 15:32:36 +0200 |
commit | d9e98c7f6b6c3331a486cabfe6cd0c07f7bfffe9 (patch) | |
tree | 03d2746e406f96f65bf284b8275a6f0e35a85947 /tools/qmllint/findwarnings.cpp | |
parent | ccd348d4b7423a23b2326c2f42c74719083248ba (diff) |
qmllint: Remove exportedQmlNames from import results
We don't need to expose them anymore.
Change-Id: Ibb25f688459972f718f9a051fbb7265c7e5b5f92
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tools/qmllint/findwarnings.cpp')
-rw-r--r-- | tools/qmllint/findwarnings.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/tools/qmllint/findwarnings.cpp b/tools/qmllint/findwarnings.cpp index 742c1a8d35..74c70ce731 100644 --- a/tools/qmllint/findwarnings.cpp +++ b/tools/qmllint/findwarnings.cpp @@ -117,16 +117,16 @@ bool FindWarningVisitor::visit(QQmlJS::AST::UiProgram *) if (!m_qmltypesFiles.isEmpty()) { const auto baseTypes = m_importer.importQmltypes(m_qmltypesFiles); - m_rootScopeImports.importedQmlNames.insert(baseTypes.importedQmlNames); + m_rootScopeImports.qmlNames.insert(baseTypes.qmlNames); m_rootScopeImports.cppNames.insert(baseTypes.cppNames); } // add "self" (as we only ever check the first part of a qualified identifier, we get away with // using an empty ScopeTree - m_rootScopeImports.importedQmlNames.insert(QFileInfo { m_filePath }.baseName(), {}); + m_rootScopeImports.qmlNames.insert(QFileInfo { m_filePath }.baseName(), {}); const auto imported = m_importer.importFileOrDirectory(QFileInfo(m_filePath).path()); - m_rootScopeImports.importedQmlNames.insert(imported.importedQmlNames); + m_rootScopeImports.qmlNames.insert(imported.qmlNames); m_rootScopeImports.cppNames.insert(imported.cppNames); const QStringList warnings = m_importer.takeWarnings(); @@ -330,7 +330,7 @@ bool FindWarningVisitor::visit(QQmlJS::AST::UiPublicMember *uipm) uipm->memberType ? uipm->memberType->name.toString() : QString(), uipm->typeModifier == QLatin1String("list"), !uipm->isReadonlyMember, false, uipm->memberType ? (uipm->memberType->name == QLatin1String("alias")) : false, 0); - property.setType(m_rootScopeImports.importedQmlNames.value(property.typeName())); + property.setType(m_rootScopeImports.qmlNames.value(property.typeName())); m_currentScope->insertPropertyIdentifier(property); } return true; @@ -480,7 +480,7 @@ bool FindWarningVisitor::visit(QQmlJS::AST::UiImport *import) const auto imported = m_importer.importFileOrDirectory( file.isRelative() ? QFileInfo(m_filePath).dir().filePath(filename) : filename, prefix); - m_rootScopeImports.importedQmlNames.insert(imported.importedQmlNames); + m_rootScopeImports.qmlNames.insert(imported.qmlNames); m_rootScopeImports.cppNames.insert(imported.cppNames); } @@ -488,7 +488,7 @@ bool FindWarningVisitor::visit(QQmlJS::AST::UiImport *import) if (!import->importId.isEmpty()) { // TODO: do not put imported ids into the same space as qml IDs const QString importId = import->importId.toString(); - m_qmlid2scope.insert(importId, m_rootScopeImports.importedQmlNames.value(importId)); + m_qmlid2scope.insert(importId, m_rootScopeImports.qmlNames.value(importId)); } auto uri = import->importUri; while (uri) { @@ -501,7 +501,7 @@ bool FindWarningVisitor::visit(QQmlJS::AST::UiImport *import) const auto imported = m_importer.importModule( path, prefix, import->version ? import->version->version : QTypeRevision()); - m_rootScopeImports.importedQmlNames.insert(imported.importedQmlNames); + m_rootScopeImports.qmlNames.insert(imported.qmlNames); m_rootScopeImports.cppNames.insert(imported.cppNames); const QStringList warnings = m_importer.takeWarnings(); @@ -534,11 +534,11 @@ bool FindWarningVisitor::visit(QQmlJS::AST::UiObjectBinding *uiob) MetaProperty prop(uiob->qualifiedId->name.toString(), name, false, true, true, name == QLatin1String("alias"), 0); - prop.setType(m_rootScopeImports.importedQmlNames.value(uiob->qualifiedTypeNameId->name.toString())); + prop.setType(m_rootScopeImports.qmlNames.value(uiob->qualifiedTypeNameId->name.toString())); m_currentScope->addProperty(prop); enterEnvironment(ScopeType::QMLScope, name); - m_currentScope->resolveTypes(m_rootScopeImports.importedQmlNames); + m_currentScope->resolveTypes(m_rootScopeImports.qmlNames); importExportedNames(m_currentScope); return true; } @@ -569,7 +569,7 @@ bool FindWarningVisitor::visit(QQmlJS::AST::UiObjectDefinition *uiod) if (name.isLower()) return false; // Ignore grouped properties for now - m_currentScope->resolveTypes(m_rootScopeImports.importedQmlNames); + m_currentScope->resolveTypes(m_rootScopeImports.qmlNames); importExportedNames(m_currentScope); if (name.endsWith("Connections")) { @@ -599,7 +599,7 @@ bool FindWarningVisitor::visit(QQmlJS::AST::UiObjectDefinition *uiod) do { scope = scope->parentScope(); // TODO: rename method } while (scope->scopeType() != ScopeType::QMLScope); - targetScope = m_rootScopeImports.importedQmlNames.value(scope->baseTypeName()); + targetScope = m_rootScopeImports.qmlNames.value(scope->baseTypeName()); } else { // there was a target, check if we already can find it auto scopeIt = m_qmlid2scope.find(target); |