diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2012-05-11 12:01:41 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-24 12:52:43 +0200 |
commit | d2e557c2c2d7fcf3bf7c1676df3902e115986dc2 (patch) | |
tree | 65f47e443efa9635a2634880c01dc439817f9566 /src/qml/qml/qqmltypeloader_p.h | |
parent | 0a3ff88f851771e52d119fab90c0254de6950585 (diff) |
Lazily create QMetaObjects
For internal QML built types, creating a metaobject each time is
just wasteful. Additionally, as the property caches were always
created from the intermediate QMetaObject, it was difficult to pass
information directly from the compiler to the property cache.
Change-Id: I769526b0edaaf16a86883f3065b75618b94e4077
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Diffstat (limited to 'src/qml/qml/qqmltypeloader_p.h')
-rw-r--r-- | src/qml/qml/qqmltypeloader_p.h | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/src/qml/qml/qqmltypeloader_p.h b/src/qml/qml/qqmltypeloader_p.h index a795d3c816..b16421a8ee 100644 --- a/src/qml/qml/qqmltypeloader_p.h +++ b/src/qml/qml/qqmltypeloader_p.h @@ -279,17 +279,8 @@ public: bool directoryExists(const QString &path); const QQmlDirParser *qmlDirParser(const QString &filePath, const QString &uriHint, QString *outUrl); - template<typename T> - void clearCache(T *o, void (T::*callback)(QQmlTypeData *)) { - TypedCallback<T> cb(o, callback); - clearCache(&TypedCallback<T>::redirect, &cb); - } - - template<typename T> - void trimCache(T *o, void (T::*callback)(QQmlTypeData *)) { - TypedCallback<T> cb(o, callback); - trimCache(&TypedCallback<T>::redirect, &cb); - } + void clearCache(); + void trimCache(); bool isTypeLoaded(const QUrl &url) const; bool isScriptLoaded(const QUrl &url) const; @@ -314,9 +305,6 @@ private: void (T::*mf)(QQmlTypeData *); }; - void clearCache(void (*callback)(void *, QQmlTypeData *), void *); - void trimCache(void (*callback)(void *, QQmlTypeData *), void *); - struct DirParser : public QQmlDirParser { QString adjustedUrl; }; typedef QHash<QUrl, QQmlTypeData *> TypeCache; |