aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2016-06-01 10:32:20 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2016-06-01 10:35:16 +0000
commit1823c1c6d75261cf0b3f247e07ac3d0c7b31f1c0 (patch)
treed2a75b876f0fd5a3d6e6282a6c230a22f541f1f6 /src/qml
parent6e86846c9a1438a2ed359292ffa0d4ae70593cd2 (diff)
Remove inheritance of QQmlCompiledData from QQmlCleanUp
The clear() re-implementation from QQmlCleanUp was empty, so this added no functionality. Commit 19c6f620dd35916466c36234231d798f79732ab0 removed the last usage of it. Change-Id: I499a6daeb1f74cc8bad1cacc5c367fde1e6eee75 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/qml')
-rw-r--r--src/qml/qml/qqmlcompileddata.cpp16
-rw-r--r--src/qml/qml/qqmlcompiler_p.h6
-rw-r--r--src/qml/qml/qqmlobjectcreator.cpp4
3 files changed, 4 insertions, 22 deletions
diff --git a/src/qml/qml/qqmlcompileddata.cpp b/src/qml/qml/qqmlcompileddata.cpp
index bd867a9b90..5344c738d8 100644
--- a/src/qml/qml/qqmlcompileddata.cpp
+++ b/src/qml/qml/qqmlcompileddata.cpp
@@ -62,7 +62,7 @@ QQmlCompiledData::QQmlCompiledData(QQmlEngine *engine)
void QQmlCompiledData::destroy()
{
- if (engine && hasEngine())
+ if (engine && compilationUnit && compilationUnit->engine)
QQmlEnginePrivate::deleteInEngineThread(engine, this);
else
delete this;
@@ -70,20 +70,6 @@ void QQmlCompiledData::destroy()
QQmlCompiledData::~QQmlCompiledData()
{
- clear();
-}
-
-void QQmlCompiledData::clear()
-{
-}
-
-void QQmlCompiledData::initialize(QQmlEngine *engine)
-{
- Q_ASSERT(!hasEngine());
- QQmlCleanup::addToEngine(engine);
- QV4::ExecutionEngine *v4 = QV8Engine::getV4(engine);
- if (compilationUnit && !compilationUnit->engine)
- compilationUnit->linkToEngine(v4);
}
QT_END_NAMESPACE
diff --git a/src/qml/qml/qqmlcompiler_p.h b/src/qml/qml/qqmlcompiler_p.h
index 4f27e3ef44..35beba1562 100644
--- a/src/qml/qml/qqmlcompiler_p.h
+++ b/src/qml/qml/qqmlcompiler_p.h
@@ -81,7 +81,7 @@ class QQmlContext;
class QQmlContextData;
// ### Merge with QV4::CompiledData::CompilationUnit
-class Q_AUTOTEST_EXPORT QQmlCompiledData : public QQmlRefCount, public QQmlCleanup
+class Q_AUTOTEST_EXPORT QQmlCompiledData : public QQmlRefCount
{
public:
QQmlCompiledData(QQmlEngine *engine);
@@ -91,12 +91,8 @@ public:
QQmlRefPointer<QV4::CompiledData::CompilationUnit> compilationUnit;
- bool isInitialized() const { return hasEngine(); }
- void initialize(QQmlEngine *);
-
protected:
virtual void destroy(); // From QQmlRefCount
- virtual void clear(); // From QQmlCleanup
private:
QQmlCompiledData(const QQmlCompiledData &other);
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp
index e2e1c6878e..546bc1d81e 100644
--- a/src/qml/qml/qqmlobjectcreator.cpp
+++ b/src/qml/qml/qqmlobjectcreator.cpp
@@ -112,8 +112,8 @@ void QQmlObjectCreator::init(QQmlContextData *providedParentContext)
engine = parentContext->engine;
v4 = QV8Engine::getV4(engine);
- if (!compiledData->isInitialized())
- compiledData->initialize(engine);
+ if (compiledData->compilationUnit && !compiledData->compilationUnit->engine)
+ compiledData->compilationUnit->linkToEngine(v4);
qmlUnit = compiledData->compilationUnit->data;
context = 0;