aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlcontextwrapper.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-05-30 22:09:46 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2013-05-31 07:05:33 +0200
commitc9e178e4f202ff4d32248682ed5e2cf5de75d0f8 (patch)
tree1bbb46a8a9b8b7aa48d2d81564a6e5c93ee952d0 /src/qml/qml/qqmlcontextwrapper.cpp
parent80ec004e7c6411997e2476a2f2c9c9f4fb41217a (diff)
Port the list wrapper over to v4
Also fix two places where we did a wrong type check. Change-Id: Ibc988b1b38803ca6acf6914487415026910f744e Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlcontextwrapper.cpp')
-rw-r--r--src/qml/qml/qqmlcontextwrapper.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/qml/qml/qqmlcontextwrapper.cpp b/src/qml/qml/qqmlcontextwrapper.cpp
index 493d55a30f..b7a236b2b8 100644
--- a/src/qml/qml/qqmlcontextwrapper.cpp
+++ b/src/qml/qml/qqmlcontextwrapper.cpp
@@ -51,6 +51,7 @@
#include <private/qv4objectproto_p.h>
#include <private/qv4mm_p.h>
#include <private/qqmltypewrapper_p.h>
+#include <private/qqmllistwrapper_p.h>
QT_BEGIN_NAMESPACE
@@ -148,7 +149,7 @@ void QmlContextWrapper::takeContextOwnership(const Value &qmlglobal)
Value QmlContextWrapper::get(Managed *m, ExecutionContext *ctx, String *name, bool *hasProperty)
{
QmlContextWrapper *resource = m->asQmlContext();
- if (!m)
+ if (!resource)
ctx->throwTypeError();
bool hasProp;
@@ -238,7 +239,7 @@ Value QmlContextWrapper::get(Managed *m, ExecutionContext *ctx, String *name, bo
QQmlListProperty<QObject> prop(context->asQQmlContext(), (void*) qintptr(propertyIdx),
QQmlContextPrivate::context_count,
QQmlContextPrivate::context_at);
- return engine->listWrapper()->newList(prop, qMetaTypeId<QQmlListProperty<QObject> >())->v4Value();
+ return QmlListWrapper::create(engine, prop, qMetaTypeId<QQmlListProperty<QObject> >());
} else {
return engine->fromVariant(cp->propertyValues.at(propertyIdx));
}
@@ -284,7 +285,7 @@ Value QmlContextWrapper::get(Managed *m, ExecutionContext *ctx, String *name, bo
void QmlContextWrapper::put(Managed *m, ExecutionContext *ctx, String *name, const Value &value)
{
QmlContextWrapper *wrapper = m->asQmlContext();
- if (!m)
+ if (!wrapper)
ctx->throwTypeError();
PropertyAttributes attrs;