aboutsummaryrefslogtreecommitdiffstats
path: root/tools/shared/qmljsimporter.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-09-29 17:02:37 +0200
committerUlf Hermann <ulf.hermann@qt.io>2020-10-02 15:32:36 +0200
commitd9e98c7f6b6c3331a486cabfe6cd0c07f7bfffe9 (patch)
tree03d2746e406f96f65bf284b8275a6f0e35a85947 /tools/shared/qmljsimporter.cpp
parentccd348d4b7423a23b2326c2f42c74719083248ba (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/shared/qmljsimporter.cpp')
-rw-r--r--tools/shared/qmljsimporter.cpp25
1 files changed, 9 insertions, 16 deletions
diff --git a/tools/shared/qmljsimporter.cpp b/tools/shared/qmljsimporter.cpp
index 4412ec01fd..4dac5466e2 100644
--- a/tools/shared/qmljsimporter.cpp
+++ b/tools/shared/qmljsimporter.cpp
@@ -137,10 +137,8 @@ void QmlJSImporter::processImport(
QmlJSImporter::ImportedTypes *types,
const QString &prefix)
{
- for (auto it = import.scripts.begin(); it != import.scripts.end(); ++it) {
- types->importedQmlNames.insert(prefixedName(prefix, it.key()), it.value());
- types->exportedQmlNames.insert(it.key(), it.value());
- }
+ for (auto it = import.scripts.begin(); it != import.scripts.end(); ++it)
+ types->qmlNames.insert(prefixedName(prefix, it.key()), it.value());
// add objects
for (auto it = import.objects.begin(); it != import.objects.end(); ++it) {
@@ -148,10 +146,8 @@ void QmlJSImporter::processImport(
types->cppNames.insert(val->internalName(), val);
const auto exports = val->exports();
- for (const auto &valExport : exports) {
- types->importedQmlNames.insert(prefixedName(prefix, valExport.type()), val);
- types->exportedQmlNames.insert(valExport.type(), val);
- }
+ for (const auto &valExport : exports)
+ types->qmlNames.insert(prefixedName(prefix, valExport.type()), val);
}
for (auto it = import.objects.begin(); it != import.objects.end(); ++it) {
@@ -257,14 +253,14 @@ ScopeTree::Ptr QmlJSImporter::localFile2ScopeTree(const QString &filePath)
while (it.hasNext()) {
ScopeTree::Ptr scope(localFile2ScopeTree(it.next()));
if (!scope->internalName().isEmpty())
- types.importedQmlNames.insert(scope->internalName(), scope);
+ types.qmlNames.insert(scope->internalName(), scope);
}
const auto imports = typeReader.imports();
for (const auto &import : imports)
importHelper(import.module, &types, import.prefix, import.version);
- result->resolveTypes(types.importedQmlNames);
+ result->resolveTypes(types.qmlNames);
return result;
}
@@ -278,8 +274,7 @@ QmlJSImporter::ImportedTypes QmlJSImporter::importFileOrDirectory(
QFileInfo fileInfo(name);
if (fileInfo.isFile()) {
ScopeTree::Ptr scope(localFile2ScopeTree(fileInfo.canonicalFilePath()));
- result.importedQmlNames.insert(prefix.isEmpty() ? scope->internalName() : prefix, scope);
- result.exportedQmlNames.insert(scope->internalName(), scope);
+ result.qmlNames.insert(prefix.isEmpty() ? scope->internalName() : prefix, scope);
return result;
}
@@ -290,10 +285,8 @@ QmlJSImporter::ImportedTypes QmlJSImporter::importFileOrDirectory(
};
while (it.hasNext()) {
ScopeTree::Ptr scope(localFile2ScopeTree(it.next()));
- if (!scope->internalName().isEmpty()) {
- result.importedQmlNames.insert(prefixedName(prefix, scope->internalName()), scope);
- result.exportedQmlNames.insert(scope->internalName(), scope);
- }
+ if (!scope->internalName().isEmpty())
+ result.qmlNames.insert(prefixedName(prefix, scope->internalName()), scope);
}
return result;