diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-11 16:28:17 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-18 13:13:33 +0200 |
commit | bdb27b96acbd38531879378c48959a5a1cd60963 (patch) | |
tree | 056f2c8c35be97a9564dee5d0ea65bed7265b7ce /src/qml/qml/qqmltypewrapper.cpp | |
parent | 8d26084ae56ba5aedd73ab733553dbf9cb3eb672 (diff) |
Use ReturnedValue for Managed::get().
Change-Id: Ia8f35d227b69d32e1f6a041283abbbd083aa34ca
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/qml/qqmltypewrapper.cpp')
-rw-r--r-- | src/qml/qml/qqmltypewrapper.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/qml/qml/qqmltypewrapper.cpp b/src/qml/qml/qqmltypewrapper.cpp index 33b8fb8e7a..8f05a877ef 100644 --- a/src/qml/qml/qqmltypewrapper.cpp +++ b/src/qml/qml/qqmltypewrapper.cpp @@ -112,7 +112,7 @@ Value QmlTypeWrapper::create(QV8Engine *v8, QObject *o, QQmlTypeNameCache *t, co } -Value QmlTypeWrapper::get(Managed *m, String *name, bool *hasProperty) +ReturnedValue QmlTypeWrapper::get(Managed *m, String *name, bool *hasProperty) { QmlTypeWrapper *w = m->as<QmlTypeWrapper>(); QV4::ExecutionEngine *v4 = m->engine(); @@ -149,13 +149,13 @@ Value QmlTypeWrapper::get(Managed *m, String *name, bool *hasProperty) bool ok; int value = e.keyToValue(enumName.constData(), &ok); if (ok) - return QV4::Value::fromInt32(value); + return QV4::Value::fromInt32(value).asReturnedValue(); } } } // check for property. - return QV4::QObjectWrapper::getQmlProperty(v4->current, context, qobjectSingleton, name, QV4::QObjectWrapper::IgnoreRevision, hasProperty); + return QV4::QObjectWrapper::getQmlProperty(v4->current, context, qobjectSingleton, name, QV4::QObjectWrapper::IgnoreRevision, hasProperty).asReturnedValue(); } else if (!siinfo->scriptApi(e).isUndefined()) { QV4::ExecutionEngine *engine = QV8Engine::getV4(v8engine); // NOTE: if used in a binding, changes will not trigger re-evaluation since non-NOTIFYable. @@ -172,14 +172,14 @@ Value QmlTypeWrapper::get(Managed *m, String *name, bool *hasProperty) bool ok = false; int value = type->enumValue(name, &ok); if (ok) - return QV4::Value::fromInt32(value); + return QV4::Value::fromInt32(value).asReturnedValue(); // Fall through to base implementation } else if (w->object) { QObject *ao = qmlAttachedPropertiesObjectById(type->attachedPropertiesId(), object); if (ao) - return QV4::QObjectWrapper::getQmlProperty(v4->current, context, ao, name, QV4::QObjectWrapper::IgnoreRevision, hasProperty); + return QV4::QObjectWrapper::getQmlProperty(v4->current, context, ao, name, QV4::QObjectWrapper::IgnoreRevision, hasProperty).asReturnedValue(); // Fall through to base implementation } @@ -196,16 +196,16 @@ Value QmlTypeWrapper::get(Managed *m, String *name, bool *hasProperty) if (r.isValid()) { QQmlContextData *context = v8engine->callingContext(); if (r.type) { - return create(w->v8, object, r.type, w->mode); + return create(w->v8, object, r.type, w->mode).asReturnedValue(); } else if (r.scriptIndex != -1) { int index = r.scriptIndex; if (index < context->importedScripts.count()) - return context->importedScripts.at(index).value(); + return context->importedScripts.at(index).value().asReturnedValue(); } else if (r.importNamespace) { - return create(w->v8, object, context->imports, r.importNamespace); + return create(w->v8, object, context->imports, r.importNamespace).asReturnedValue(); } - return QV4::Value::undefinedValue(); + return QV4::Value::undefinedValue().asReturnedValue(); } |