diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-26 13:05:25 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-28 13:33:58 +0200 |
commit | 62d1b5a08aa2c21c95a2a77afbe34c38ed37a2aa (patch) | |
tree | d9e542dfb9d7fa5d8e1c71633f6cd18cf234b5e6 /src/qml/types | |
parent | 112531bc23494ba3c5cf2e0a51b2d654be28dbfd (diff) |
Fix API for Object::define*Property
use ValueRef instead of const Value &.
Change-Id: I3fd0ca829870db27f036825d713c53dc0600be07
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/types')
-rw-r--r-- | src/qml/types/qqmldelegatemodel.cpp | 2 | ||||
-rw-r--r-- | src/qml/types/qquickworkerscript.cpp | 9 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp index 708dd8dbb2..8f56ba968e 100644 --- a/src/qml/types/qqmldelegatemodel.cpp +++ b/src/qml/types/qqmldelegatemodel.cpp @@ -90,7 +90,7 @@ struct DelegateModelGroupFunction: QV4::FunctionObject if (!o) v4->current->throwTypeError(QStringLiteral("Not a valid VisualData object")); - QV4::Value v = callData->argc ? callData->args[0] : QV4::Primitive::undefinedValue(); + QV4::ScopedValue v(scope, callData->argument(0)); return f->code(o->item, f->flag, v); } }; diff --git a/src/qml/types/qquickworkerscript.cpp b/src/qml/types/qquickworkerscript.cpp index 43732332c9..f789f999a4 100644 --- a/src/qml/types/qquickworkerscript.cpp +++ b/src/qml/types/qquickworkerscript.cpp @@ -288,14 +288,13 @@ QV4::ReturnedValue QQuickWorkerScriptEnginePrivate::method_sendMessage(QV4::Simp int id = ctx->callData->argc > 1 ? ctx->callData->args[1].toInt32() : 0; - QByteArray data = QV4::Serialize::serialize(ctx->callData->argc > 2 ? ctx->callData->args[2] : QV4::Primitive::undefinedValue(), engine); + QV4::Scope scope(ctx); + QV4::ScopedValue v(scope, ctx->callData->argument(2)); + QByteArray data = QV4::Serialize::serialize(v, engine); QMutexLocker locker(&engine->p->m_lock); WorkerScript *script = engine->p->workers.value(id); - if (!script) - return QV4::Encode::undefined(); - - if (script->owner) + if (script && script->owner) QCoreApplication::postEvent(script->owner, new WorkerDataEvent(0, data)); return QV4::Encode::undefined(); |