diff options
author | Glenn Watson <glenn.watson@nokia.com> | 2012-07-24 11:41:50 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-08-08 07:55:19 +0200 |
commit | 6ebf215fdaf2d757ab90ae4d46c4b938e978e2dc (patch) | |
tree | 515da352f1cc4d5567b6d93f0b19952b2e27d705 /src/qml/qml/qqmltypenamecache_p.h | |
parent | 92562eacbc3c614a83a734f1108ed7df02415eae (diff) |
Add type name to singleton (module api) implementations.
This change renames the previous module api implementation
to singleton types.
When a singleton type is registered, a type name must be provided
that is used when accessing the API from QML. This makes the
implementation more consistent with the rest of QML.
Task-number: QTBUG-26549
Change-Id: Iab0bb1ccf516bd3ae20aee562a64d22976e0aecd
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Diffstat (limited to 'src/qml/qml/qqmltypenamecache_p.h')
-rw-r--r-- | src/qml/qml/qqmltypenamecache_p.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/qml/qml/qqmltypenamecache_p.h b/src/qml/qml/qqmltypenamecache_p.h index a9268db37a..841c5aef6b 100644 --- a/src/qml/qml/qqmltypenamecache_p.h +++ b/src/qml/qml/qqmltypenamecache_p.h @@ -74,6 +74,7 @@ public: inline bool isEmpty() const; void add(const QHashedString &name, int sciptIndex = -1, const QHashedString &nameSpace = QHashedString()); + void addSingletonType(const QHashedString &name, QQmlMetaType::SingletonInstance *apiInstance, const QHashedString &nameSpace = QHashedString()); struct Result { inline Result(); @@ -92,7 +93,7 @@ public: Result query(const QHashedStringRef &, const void *importNamespace); Result query(const QHashedV8String &); Result query(const QHashedV8String &, const void *importNamespace); - QQmlMetaType::ModuleApiInstance *moduleApi(const void *importNamespace); + QQmlMetaType::SingletonInstance *singletonType(const void *importNamespace); private: friend class QQmlImports; @@ -100,7 +101,7 @@ private: struct Import { inline Import(); // Imported module - QQmlMetaType::ModuleApiInstance *moduleApi; + QQmlMetaType::SingletonInstance *singletonType; QVector<QQmlTypeModuleVersion> modules; // Or, imported script @@ -172,7 +173,7 @@ bool QQmlTypeNameCache::Result::isValid() const } QQmlTypeNameCache::Import::Import() -: moduleApi(0), scriptIndex(-1) +: singletonType(0), scriptIndex(-1) { } |