aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlcontextwrapper.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-06-06 14:52:07 +0200
committerLars Knoll <lars.knoll@digia.com>2013-06-07 18:32:55 +0200
commitac15ec470ebc8fe0e66550ce1183187e3868bb40 (patch)
treeeed2590ff5535315839898d15ca3b31e0a70ec3f /src/qml/qml/qqmlcontextwrapper.cpp
parente058cc234c7bb3065b092bed304b7da9f3f98bed (diff)
Get rid of QV8QObjectWrapper::getProperty
Replace the call sites with calls to getQmlProperty on the QObjectWrapper. Change-Id: I3dbc3788c8d1631d817f65c738f0a8a31deb2866 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlcontextwrapper.cpp')
-rw-r--r--src/qml/qml/qqmlcontextwrapper.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/qml/qml/qqmlcontextwrapper.cpp b/src/qml/qml/qqmlcontextwrapper.cpp
index 4d8a8ac3dd..dd7d28ce66 100644
--- a/src/qml/qml/qqmlcontextwrapper.cpp
+++ b/src/qml/qml/qqmlcontextwrapper.cpp
@@ -190,7 +190,6 @@ Value QmlContextWrapper::get(Managed *m, ExecutionContext *ctx, String *name, bo
}
QQmlEnginePrivate *ep = QQmlEnginePrivate::get(engine->engine());
- QV8QObjectWrapper *qobjectWrapper = engine->qobjectWrapper();
while (context) {
// Search context properties
@@ -231,7 +230,7 @@ Value QmlContextWrapper::get(Managed *m, ExecutionContext *ctx, String *name, bo
if (scopeObject) {
if (QV4::QObjectWrapper *o = QV4::QObjectWrapper::wrap(ctx->engine, scopeObject).as<QV4::QObjectWrapper>()) {
bool hasProp = false;
- QV4::Value result = o->getQmlProperty(o->engine()->current, propertystring.string().asString(), QV4::QObjectWrapper::CheckRevision, &hasProp);
+ QV4::Value result = o->getQmlProperty(ctx, context, name, QV4::QObjectWrapper::CheckRevision, &hasProp);
if (hasProp) {
if (hasProperty)
*hasProperty = true;
@@ -244,12 +243,14 @@ Value QmlContextWrapper::get(Managed *m, ExecutionContext *ctx, String *name, bo
// Search context object
if (context->contextObject) {
- QV4::Value result = qobjectWrapper->getProperty(context->contextObject, propertystring,
- context, QV4::QObjectWrapper::CheckRevision)->v4Value();
- if (!result.isEmpty()) {
- if (hasProperty)
- *hasProperty = true;
- return result;
+ if (QV4::QObjectWrapper *o = QV4::QObjectWrapper::wrap(ctx->engine, context->contextObject).as<QV4::QObjectWrapper>()) {
+ bool hasProp = false;
+ QV4::Value result = o->getQmlProperty(ctx, context, name, QV4::QObjectWrapper::CheckRevision, &hasProp);
+ if (hasProp) {
+ if (hasProperty)
+ *hasProperty = true;
+ return result;
+ }
}
}