aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmltypeloader_p.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2018-04-24 10:44:05 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2018-04-26 09:56:53 +0000
commit99b7f1b50267071023bcc35e094b61eb0e568b5d (patch)
treefce977d20fcdbe5ae4bb314e8dc7457795135d1d /src/qml/qml/qqmltypeloader_p.h
parentf741956de935ab9f954afa53b32a167c0c7528ea (diff)
Clean up manual reference counting of QQmlQmldirData
Finally the handling of the asynchronously retrievable qqmldir data obtained via QQmlTypeLoader::getQmldir(url) becomes simpler when doing QQmlRefPointer. Change-Id: I557980482f8d1a3c7e4189dee92564ec5e6dfb48 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/qml/qqmltypeloader_p.h')
-rw-r--r--src/qml/qml/qqmltypeloader_p.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/qml/qml/qqmltypeloader_p.h b/src/qml/qml/qqmltypeloader_p.h
index 2418f3f716..66b1eaf18e 100644
--- a/src/qml/qml/qqmltypeloader_p.h
+++ b/src/qml/qml/qqmltypeloader_p.h
@@ -279,14 +279,13 @@ public:
bool addImport(const QV4::CompiledData::Import *import, QList<QQmlError> *errors);
bool fetchQmldir(const QUrl &url, const QV4::CompiledData::Import *import, int priority, QList<QQmlError> *errors);
- bool updateQmldir(QQmlQmldirData *data, const QV4::CompiledData::Import *import, QList<QQmlError> *errors);
+ bool updateQmldir(const QQmlRefPointer<QQmlQmldirData> &data, const QV4::CompiledData::Import *import, QList<QQmlError> *errors);
private:
- virtual bool qmldirDataAvailable(QQmlQmldirData *, QList<QQmlError> *);
+ virtual bool qmldirDataAvailable(const QQmlRefPointer<QQmlQmldirData> &, QList<QQmlError> *);
virtual void scriptImported(const QQmlRefPointer<QQmlScriptBlob> &, const QV4::CompiledData::Location &, const QString &, const QString &) {}
- void dependencyError(QQmlDataBlob *) override;
void dependencyComplete(QQmlDataBlob *) override;
protected:
@@ -296,7 +295,7 @@ public:
QQmlImports m_importCache;
QHash<const QV4::CompiledData::Import*, int> m_unresolvedImports;
- QList<QQmlQmldirData *> m_qmldirs;
+ QVector<QQmlRefPointer<QQmlQmldirData>> m_qmldirs;
QQmlMetaType::CachedUnitLookupError m_cachedUnitStatus = QQmlMetaType::CachedUnitLookupError::NoError;
};
@@ -309,7 +308,7 @@ public:
QQmlRefPointer<QQmlTypeData> getType(const QByteArray &, const QUrl &url, Mode mode = PreferSynchronous);
QQmlRefPointer<QQmlScriptBlob> getScript(const QUrl &);
- QQmlQmldirData *getQmldir(const QUrl &);
+ QQmlRefPointer<QQmlQmldirData> getQmldir(const QUrl &);
QString absoluteFilePath(const QString &path);
bool directoryExists(const QString &path);