diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2016-06-14 11:11:18 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2016-06-16 18:00:32 +0000 |
commit | c2c13cacd450d866e60c58c87ff1ab16ae736804 (patch) | |
tree | 036a78caefe83045508bd18b3fe9c41aec32fe25 /src/qml/compiler/qqmlirbuilder_p.h | |
parent | 79745bf95cfb656b7ea75850c2b378cac3ea18ec (diff) |
Clean up property cache creation code
* Reduce the complexity of the recursive tree traversal by moving
the base type property cache creation into a helper function and using a
context to encapsulate the origin of the current traversal
* ensureVMEMetaObject() had only one call site and it's easiest to
inline that for now.
* Transition to a new state-less error handling, so that in the future
this code can be used without the QQmlTypeCompiler dependency, which
will be needed for loading of compilation units from disk.
* A few missing consts.
Change-Id: Ibe7209c357a3c7e101fac6960ece40a033e55f72
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/compiler/qqmlirbuilder_p.h')
-rw-r--r-- | src/qml/compiler/qqmlirbuilder_p.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/qml/compiler/qqmlirbuilder_p.h b/src/qml/compiler/qqmlirbuilder_p.h index b7e3e883bc..8d671961c6 100644 --- a/src/qml/compiler/qqmlirbuilder_p.h +++ b/src/qml/compiler/qqmlirbuilder_p.h @@ -523,11 +523,11 @@ private: #ifndef V4_BOOTSTRAP struct Q_QML_EXPORT PropertyResolver { - PropertyResolver(QQmlPropertyCache *cache) + PropertyResolver(const QQmlPropertyCache *cache) : cache(cache) {} - QQmlPropertyData *property(int index) + QQmlPropertyData *property(int index) const { return cache->property(index); } @@ -537,12 +537,12 @@ struct Q_QML_EXPORT PropertyResolver IgnoreRevision }; - QQmlPropertyData *property(const QString &name, bool *notInRevision = 0, RevisionCheck check = CheckRevision); + QQmlPropertyData *property(const QString &name, bool *notInRevision = 0, RevisionCheck check = CheckRevision) const; // This code must match the semantics of QQmlPropertyPrivate::findSignalByName - QQmlPropertyData *signal(const QString &name, bool *notInRevision); + QQmlPropertyData *signal(const QString &name, bool *notInRevision) const; - QQmlPropertyCache *cache; + const QQmlPropertyCache *cache; }; #endif |