diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2021-12-09 18:28:48 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2021-12-12 20:26:10 +0100 |
commit | 75df19165e5f8a4702ce465f5e56d667f16324ea (patch) | |
tree | 26e842d3003d67267b0641ab4a498b04bbff84f6 /src/qmlcompiler/qqmljsscope_p.h | |
parent | 62e6ac6a81db013ac52a8e0a93ef777ae91e27f8 (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.h | 8 |
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; |