aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmltypewrapper.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/qqmltypewrapper.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/qqmltypewrapper.cpp')
-rw-r--r--src/qml/qml/qqmltypewrapper.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/qml/qml/qqmltypewrapper.cpp b/src/qml/qml/qqmltypewrapper.cpp
index 5074590bcc..e98117e440 100644
--- a/src/qml/qml/qqmltypewrapper.cpp
+++ b/src/qml/qml/qqmltypewrapper.cpp
@@ -158,7 +158,10 @@ Value QmlTypeWrapper::get(Managed *m, ExecutionContext *ctx, String *name, bool
}
// check for property.
- return v8engine->qobjectWrapper()->getProperty(qobjectSingleton, propertystring, context, QV4::QObjectWrapper::IgnoreRevision)->v4Value();
+ if (QV4::QObjectWrapper *o = QV4::QObjectWrapper::wrap(ctx->engine, qobjectSingleton).as<QV4::QObjectWrapper>())
+ return o->getQmlProperty(ctx, context, name, QV4::QObjectWrapper::IgnoreRevision);
+ else
+ return QV4::Value::undefinedValue();
} 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.
@@ -181,9 +184,11 @@ Value QmlTypeWrapper::get(Managed *m, ExecutionContext *ctx, String *name, bool
} else if (w->object) {
QObject *ao = qmlAttachedPropertiesObjectById(type->attachedPropertiesId(), object);
- if (ao)
- return v8engine->qobjectWrapper()->getProperty(ao, propertystring, context,
- QV4::QObjectWrapper::IgnoreRevision)->v4Value();
+ if (ao) {
+ QV4::QObjectWrapper *wrapper = QV4::QObjectWrapper::wrap(ctx->engine, ao).as<QV4::QObjectWrapper>();
+ if (wrapper)
+ return wrapper->getQmlProperty(ctx, context, name, QV4::QObjectWrapper::IgnoreRevision);
+ }
// Fall through to base implementation
}