diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-27 09:45:55 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-30 08:05:46 +0200 |
commit | 0e36db9f1179d1bdf0710494e98ff7aee1a2d836 (patch) | |
tree | e9f00fe028ee24b4412e3bb8418a3381e81c772b /src/qml/qml/qqmlcontextwrapper.cpp | |
parent | 472c8e6bed0b18c4e853c905ace07a09c64c29d2 (diff) |
Remove most uses of Value from qml/qml
Change-Id: I409a8505a9e01f86d777bc694d24516d1c8f0c4d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlcontextwrapper.cpp')
-rw-r--r-- | src/qml/qml/qqmlcontextwrapper.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/qml/qml/qqmlcontextwrapper.cpp b/src/qml/qml/qqmlcontextwrapper.cpp index 15974b07fa..c867b6e126 100644 --- a/src/qml/qml/qqmlcontextwrapper.cpp +++ b/src/qml/qml/qqmlcontextwrapper.cpp @@ -105,23 +105,26 @@ QQmlContextData *QmlContextWrapper::callingContext(ExecutionEngine *v4) return !!c ? c->getContext() : 0; } -QQmlContextData *QmlContextWrapper::getContext(const Value &value) +QQmlContextData *QmlContextWrapper::getContext(const ValueRef value) { - QV4::ExecutionEngine *v4 = value.engine(); + QV4::ExecutionEngine *v4 = value->engine(); if (!v4) return 0; Scope scope(v4); - QV4::Scoped<QmlContextWrapper> c(scope, value.as<QmlContextWrapper>()); + QV4::Scoped<QmlContextWrapper> c(scope, value); - return !!c ? c->getContext():0; + return c ? c->getContext() : 0; } -void QmlContextWrapper::takeContextOwnership(const Value &qmlglobal) +void QmlContextWrapper::takeContextOwnership(const ValueRef qmlglobal) { - Object *o = qmlglobal.asObject(); - QmlContextWrapper *c = o ? o->as<QmlContextWrapper>() : 0; - assert(c); + QV4::ExecutionEngine *v4 = qmlglobal->engine(); + Q_ASSERT(v4); + + Scope scope(v4); + QV4::Scoped<QmlContextWrapper> c(scope, qmlglobal); + Q_ASSERT(c); c->ownsContext = true; } |