aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmltypeloader_p.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2018-03-09 16:40:38 +0100
committerSimon Hausmann <simon.hausmann@qt.io>2018-03-20 09:44:11 +0000
commit64e90f393146dadb382d154e7d67a9109ab2492a (patch)
treec1079ff6af2c9fca9357a9313fffe5590e30dfce /src/qml/qml/qqmltypeloader_p.h
parent22b13921f8067f8a93164875a4ad59bed85b0400 (diff)
Fix QML data structure version checking for ahead-of-time generated files
We must also do version checking for QML and JS files that were compiled ahead of time and are embedded in resources. If the lookup for the original source code fails, then we must generate an appropriate error message. As an upside we get better error reporting when trying to load an empty file and Qt.include() now reports the error message in the statusText field. The error reporting for imported scripts was not changed as importing an empty script is (oddly) allowed. Task-number: QTBUG-66986 Change-Id: Ie0ef81af371a51ecf8c66ae7954d43f5cc6c12de Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/qml/qml/qqmltypeloader_p.h')
-rw-r--r--src/qml/qml/qqmltypeloader_p.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qml/qml/qqmltypeloader_p.h b/src/qml/qml/qqmltypeloader_p.h
index 4665d342c1..5988632547 100644
--- a/src/qml/qml/qqmltypeloader_p.h
+++ b/src/qml/qml/qqmltypeloader_p.h
@@ -140,11 +140,13 @@ public:
QString readAll(QString *error) const;
QDateTime sourceTimeStamp() const;
bool exists() const;
+ bool isEmpty() const;
private:
friend class QQmlDataBlob;
friend class QQmlTypeLoader;
QString inlineSourceCode;
QFileInfo fileInfo;
+ bool hasInlineSourceCode = false;
};
protected:
@@ -271,6 +273,8 @@ public:
const QQmlImports &imports() const { return m_importCache; }
+ void setCachedUnitStatus(QQmlMetaType::CachedUnitLookupError status) { m_cachedUnitStatus = status; }
+
protected:
bool addImport(const QV4::CompiledData::Import *import, QList<QQmlError> *errors);
@@ -293,6 +297,7 @@ public:
QQmlImports m_importCache;
QHash<const QV4::CompiledData::Import*, int> m_unresolvedImports;
QList<QQmlQmldirData *> m_qmldirs;
+ QQmlMetaType::CachedUnitLookupError m_cachedUnitStatus = QQmlMetaType::CachedUnitLookupError::NoError;
};
QQmlTypeLoader(QQmlEngine *);