aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlcompiler/qqmljsscope_p.h
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-12-09 18:28:48 +0100
committerUlf Hermann <ulf.hermann@qt.io>2021-12-12 20:26:10 +0100
commit75df19165e5f8a4702ce465f5e56d667f16324ea (patch)
tree26e842d3003d67267b0641ab4a498b04bbff84f6 /src/qmlcompiler/qqmljsscope_p.h
parent62e6ac6a81db013ac52a8e0a93ef777ae91e27f8 (diff)
QQmlJSScope: Avoid lazy-loading for the internal name or isComposite()
If the scope has a factory it is composite as the factory can only load composite types. The internal name is derived from the file name. We can provide that without loading the type. Change-Id: Ib57e951d91220fb8db71b6d04929a7aa4b5bab5d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljsscope_p.h')
-rw-r--r--src/qmlcompiler/qqmljsscope_p.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/qmlcompiler/qqmljsscope_p.h b/src/qmlcompiler/qqmljsscope_p.h
index 81ce7e9dc1..8e45ccc32d 100644
--- a/src/qmlcompiler/qqmljsscope_p.h
+++ b/src/qmlcompiler/qqmljsscope_p.h
@@ -45,8 +45,9 @@
#include <QtQml/private/qqmljssourcelocation_p.h>
-#include <QtCore/qset.h>
+#include <QtCore/qfileinfo.h>
#include <QtCore/qhash.h>
+#include <QtCore/qset.h>
#include <QtCore/qstring.h>
#include <QtCore/qversionnumber.h>
@@ -74,6 +75,11 @@ public:
return !m_filePath.isEmpty() && m_importer != nullptr;
}
+ QString internalName() const
+ {
+ return QFileInfo(m_filePath).baseName();
+ }
+
private:
QString m_filePath;
QQmlJSImporter *m_importer = nullptr;