aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmltypeloader.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2016-06-01 12:22:11 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2016-06-01 17:33:50 +0000
commit1f3f6d3e7d81dc11658a46003e86e921edb35bdf (patch)
treef16e5535451a755d0a550839de5f19a8d2fb6b6c /src/qml/qml/qqmltypeloader.cpp
parent3b14f29b8e5b889c7682eaca3e750493a05bcdb8 (diff)
Remove QQmlCompiledData in favor of QV4::CompiledData::CompilationUnit
QQmlCompiledData used to contain the binary data for instantiating QML types in the QML VME. Nowadays the QML type compiler as well as the JavaScript compiler create a QV4::CompiledData::CompilationUnit. Change-Id: I155f62a5ecfb55a3fe230520231b6d8fd5b28ac9 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Diffstat (limited to 'src/qml/qml/qqmltypeloader.cpp')
-rw-r--r--src/qml/qml/qqmltypeloader.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp
index 4ec3dfe6a5..b2f4c6749d 100644
--- a/src/qml/qml/qqmltypeloader.cpp
+++ b/src/qml/qml/qqmltypeloader.cpp
@@ -45,7 +45,6 @@
#include <private/qqmlengine_p.h>
#include <private/qqmlglobal_p.h>
#include <private/qqmlthread_p.h>
-#include <private/qqmlcompiler_p.h>
#include <private/qqmlcomponent_p.h>
#include <private/qqmlprofiler_p.h>
#include <private/qqmlmemoryprofiler_p.h>
@@ -2047,7 +2046,7 @@ const QList<QQmlTypeData::TypeReference> &QQmlTypeData::compositeSingletons() co
return m_compositeSingletons;
}
-QQmlCompiledData *QQmlTypeData::compiledData() const
+QV4::CompiledData::CompilationUnit *QQmlTypeData::compilationUnit() const
{
return m_compiledData;
}
@@ -2304,13 +2303,12 @@ void QQmlTypeData::compile()
{
Q_ASSERT(m_compiledData == 0);
- m_compiledData = new QQmlCompiledData(typeLoader()->engine());
-
- QQmlTypeCompiler compiler(QQmlEnginePrivate::get(typeLoader()->engine()), m_compiledData, this, m_document.data());
- if (!compiler.compile()) {
+ QQmlTypeCompiler compiler(QQmlEnginePrivate::get(typeLoader()->engine()), this, m_document.data());
+ m_compiledData = compiler.compile();
+ if (m_compiledData) {
+ m_compiledData->addref();
+ } else {
setError(compiler.compilationErrors());
- m_compiledData->release();
- m_compiledData = 0;
}
}