diff options
author | Lars Knoll <lars.knoll@theqtcompany.com> | 2015-01-13 09:01:29 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@digia.com> | 2015-01-13 22:42:04 +0100 |
commit | 39f1e0d66dc434e764731fbfed29c8fd98d217aa (patch) | |
tree | d9855dbedd752c23395ccb6d4d3dc8fc3bece254 /src/qml/types | |
parent | a38f9ec6c96559efa56e8f7346f74f5990810c3a (diff) |
Make sure we always have an engine when assigning to a Persistent
This prepares things for a rewrite of the internals of Persistent.
Change-Id: Ib93ec5911984d1bfce87ffdc3f86bc75f6ecafe9
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/types')
-rw-r--r-- | src/qml/types/qqmldelegatemodel.cpp | 4 | ||||
-rw-r--r-- | src/qml/types/qquickworkerscript.cpp | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp index 88cb086d32..8309df8403 100644 --- a/src/qml/types/qqmldelegatemodel.cpp +++ b/src/qml/types/qqmldelegatemodel.cpp @@ -1757,7 +1757,7 @@ void QQmlDelegateModelItemMetaType::initializePrototype() p->setSetter(0); proto->insertMember(s, p, QV4::Attr_Accessor|QV4::Attr_NotConfigurable|QV4::Attr_NotEnumerable); } - modelItemProto = proto; + modelItemProto.set(v4, proto); } int QQmlDelegateModelItemMetaType::parseGroups(const QStringList &groups) const @@ -3341,7 +3341,7 @@ QQmlDelegateModelEngineData::QQmlDelegateModelEngineData(QV4::ExecutionEngine *v proto->defineAccessorProperty(QStringLiteral("index"), QQmlDelegateModelGroupChange::method_get_index, 0); proto->defineAccessorProperty(QStringLiteral("count"), QQmlDelegateModelGroupChange::method_get_count, 0); proto->defineAccessorProperty(QStringLiteral("moveId"), QQmlDelegateModelGroupChange::method_get_moveId, 0); - changeProto = proto; + changeProto.set(v4, proto); } QQmlDelegateModelEngineData::~QQmlDelegateModelEngineData() diff --git a/src/qml/types/qquickworkerscript.cpp b/src/qml/types/qquickworkerscript.cpp index b822c155b6..4ad2c34247 100644 --- a/src/qml/types/qquickworkerscript.cpp +++ b/src/qml/types/qquickworkerscript.cpp @@ -222,7 +222,7 @@ void QQuickWorkerScriptEnginePrivate::WorkerEngine::init() QV4::Scope scope(m_v4Engine); QV4::ScopedContext globalContext(scope, scope.engine->rootContext()); - onmessage = QV4::Script(globalContext, QString::fromUtf8(CALL_ONMESSAGE_SCRIPT)).run(); // do not use QStringLiteral here, MSVC2012 cannot apply this cleanly to the macro + onmessage.set(scope.engine, QV4::Script(globalContext, QString::fromUtf8(CALL_ONMESSAGE_SCRIPT)).run()); // do not use QStringLiteral here, MSVC2012 cannot apply this cleanly to the macro Q_ASSERT(!scope.engine->hasException); QV4::Script createsendscript(globalContext, QString::fromUtf8(SEND_MESSAGE_CREATE_SCRIPT)); // do not use QStringLiteral here, MSVC2012 cannot apply this cleanly to the macro QV4::ScopedFunctionObject createsendconstructor(scope, createsendscript.run()); @@ -233,7 +233,7 @@ void QQuickWorkerScriptEnginePrivate::WorkerEngine::init() QV4::ScopedCallData callData(scope, 1); callData->args[0] = function; callData->thisObject = global(); - createsend = createsendconstructor->call(callData); + createsend.set(scope.engine, createsendconstructor->call(callData)); } // Requires handle and context scope @@ -300,7 +300,7 @@ QV4::ReturnedValue QQuickWorkerScriptEnginePrivate::getWorker(WorkerScript *scri QV4::ExecutionEngine *v4 = QV8Engine::getV4(workerEngine); QV4::Scope scope(v4); - script->object = QV4::QmlContextWrapper::urlScope(v4, script->source); + script->object.set(v4, QV4::QmlContextWrapper::urlScope(v4, script->source)); QV4::Scoped<QV4::QmlContextWrapper> w(scope, script->object.value()); Q_ASSERT(!!w); |