diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-01-23 11:26:29 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2015-01-23 13:15:42 +0100 |
commit | bca7c4195a9898f1aaee0c91776f4302010fe2f0 (patch) | |
tree | 1732d4f1c23ca588266fdc386aceff4e9ccc1391 /src/qml/qml/qqmltypeloader_p.h | |
parent | 203e85619612c73a01b68d8538819cf0ea685dab (diff) |
Typeloader cleanup
The QQmlDataBlob base class had a typeloader member that was provided with
startLoading() later, just to allow calling the url interceptor. The one
sub-class of QQmlDataBlob - QQmlTypeLoader::Blob - also had a typeloader
pointer, provided at constructor time.
This patch cleans this up by removing the duplicated typeloader pointer in the
sub-class and passing it straight through to the base-class at construction
type. This also allows moving the url interception to the constructor.
Also fixed the findCachedCompilationUnit calls to use the url after applying
the intercept and removed one unnecessary findCachedCompilationUnit call - the
QFile::exists call is sufficient.
Change-Id: If5c49d38a6ec66fea6cd7c21013c046cf75acafd
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmltypeloader_p.h')
-rw-r--r-- | src/qml/qml/qqmltypeloader_p.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/qml/qml/qqmltypeloader_p.h b/src/qml/qml/qqmltypeloader_p.h index 64e3937a74..f5c15d0513 100644 --- a/src/qml/qml/qqmltypeloader_p.h +++ b/src/qml/qml/qqmltypeloader_p.h @@ -96,10 +96,12 @@ public: QmldirFile = QQmlAbstractUrlInterceptor::QmldirFile }; - QQmlDataBlob(const QUrl &, Type); + QQmlDataBlob(const QUrl &, Type, QQmlTypeLoader* manager); virtual ~QQmlDataBlob(); - void startLoading(QQmlTypeLoader* manager); + void startLoading(); + + QQmlTypeLoader *typeLoader() const { return m_typeLoader; } Type type() const; @@ -156,6 +158,11 @@ protected: // Callbacks made in main thread virtual void downloadProgressChanged(qreal); virtual void completed(); + +protected: + // Manager that is currently fetching data for me + QQmlTypeLoader *m_typeLoader; + private: friend class QQmlTypeLoader; friend class QQmlTypeLoaderThread; @@ -197,8 +204,6 @@ private: // List of QQmlDataBlob's that I am waiting for to complete. QList<QQmlDataBlob *> m_waitingFor; - // Manager that is currently fetching data for me - QQmlTypeLoader *m_manager; int m_redirectCount:30; bool m_inCallback:1; bool m_isDone:1; @@ -218,7 +223,6 @@ public: Blob(const QUrl &url, QQmlDataBlob::Type type, QQmlTypeLoader *loader); ~Blob(); - QQmlTypeLoader *typeLoader() const { return m_typeLoader; } const QQmlImports &imports() const { return m_importCache; } protected: @@ -239,7 +243,6 @@ public: protected: virtual QString stringAt(int) const { return QString(); } - QQmlTypeLoader *m_typeLoader; QQmlImports m_importCache; bool m_isSingleton; QHash<const QV4::CompiledData::Import*, int> m_unresolvedImports; |