diff options
author | Lars Knoll <lars.knoll@theqtcompany.com> | 2015-01-02 15:07:35 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@digia.com> | 2015-01-09 10:27:57 +0100 |
commit | ca977a0c8fa25d5df4dbddba08bc2fb022df7c1c (patch) | |
tree | 24953329bba5bbb7ea8611d09098b8a6c8ba39c3 /src/qml/qml/qqmlvmemetaobject.cpp | |
parent | 7041eb353a4ad416f51245cc17342e16b3a02a9b (diff) |
Cleanup variant conversion code
Make public methods proper members of the ExecutionEngine, and
move private methods into the .cpp file only.
Change-Id: I3ca49e39bb1c4e559a2c63346e6ae6cfa446147d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlvmemetaobject.cpp')
-rw-r--r-- | src/qml/qml/qqmlvmemetaobject.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/qml/qml/qqmlvmemetaobject.cpp b/src/qml/qml/qqmlvmemetaobject.cpp index 59fae5fcbd..6636b3a8e4 100644 --- a/src/qml/qml/qqmlvmemetaobject.cpp +++ b/src/qml/qml/qqmlvmemetaobject.cpp @@ -945,7 +945,7 @@ int QQmlVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a) callData->thisObject = ep->v8engine()->global(); for (int ii = 0; ii < data->parameterCount; ++ii) - callData->args[ii] = QV4::ExecutionEngine::fromVariant(scope.engine, *(QVariant *)a[ii + 1]); + callData->args[ii] = scope.engine->fromVariant(*(QVariant *)a[ii + 1]); QV4::ScopedValue result(scope); result = function->call(callData); @@ -955,7 +955,7 @@ int QQmlVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a) ep->warning(error); if (a[0]) *(QVariant *)a[0] = QVariant(); } else { - if (a[0]) *(QVariant *)a[0] = QV4::ExecutionEngine::toVariant(scope.engine, result, 0); + if (a[0]) *(QVariant *)a[0] = scope.engine->toVariant(result, 0); } ep->dereferenceScarceResources(); // "release" scarce resources if top-level expression evaluation is complete. @@ -1004,7 +1004,7 @@ QVariant QQmlVMEMetaObject::readPropertyAsVariant(int id) QV4::Scope scope(v4); QV4::ScopedObject o(scope, varProperties.value()); QV4::ScopedValue val(scope, o->getIndexed(id - firstVarPropertyIndex)); - return QV4::ExecutionEngine::toVariant(scope.engine, val, -1); + return scope.engine->toVariant(val, -1); } return QVariant(); } else { @@ -1077,7 +1077,7 @@ void QQmlVMEMetaObject::writeProperty(int id, const QVariant &value) // And, if the new value is a scarce resource, we need to ensure that it does not get // automatically released by the engine until no other references to it exist. - QV4::ScopedValue newv(scope, QV4::ExecutionEngine::fromVariant(scope.engine, value)); + QV4::ScopedValue newv(scope, scope.engine->fromVariant(value)); QV4::Scoped<QV4::VariantObject> v(scope, newv); if (!!v) v->addVmePropertyReference(); |