From ef6b4938b9ec309d5faf0c966cb2b58f3de2ca77 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 15 Jan 2015 21:54:12 +0100 Subject: Cleanups Simplify some code in BooleanObject Simplify access to call arguments and thisObject Change-Id: I2f8e844019bc587385608beb02f05b15f827535c Reviewed-by: Simon Hausmann --- src/qml/types/qqmldelegatemodel.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/qml/types/qqmldelegatemodel.cpp') diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp index 96f5b008b1..81210b2036 100644 --- a/src/qml/types/qqmldelegatemodel.cpp +++ b/src/qml/types/qqmldelegatemodel.cpp @@ -1802,7 +1802,7 @@ int QQmlDelegateModelItemMetaType::parseGroups(const QV4::Value &groups) const QV4::ReturnedValue QQmlDelegateModelItem::get_model(QV4::CallContext *ctx) { QV4::Scope scope(ctx); - QV4::Scoped o(scope, ctx->d()->callData->thisObject.as()); + QV4::Scoped o(scope, ctx->thisObject().as()); if (!o) return ctx->engine()->throwTypeError(QStringLiteral("Not a valid VisualData object")); if (!o->d()->item->metaType->model) @@ -1814,7 +1814,7 @@ QV4::ReturnedValue QQmlDelegateModelItem::get_model(QV4::CallContext *ctx) QV4::ReturnedValue QQmlDelegateModelItem::get_groups(QV4::CallContext *ctx) { QV4::Scope scope(ctx); - QV4::Scoped o(scope, ctx->d()->callData->thisObject.as()); + QV4::Scoped o(scope, ctx->thisObject().as()); if (!o) return ctx->engine()->throwTypeError(QStringLiteral("Not a valid VisualData object")); @@ -1830,17 +1830,17 @@ QV4::ReturnedValue QQmlDelegateModelItem::get_groups(QV4::CallContext *ctx) QV4::ReturnedValue QQmlDelegateModelItem::set_groups(QV4::CallContext *ctx) { QV4::Scope scope(ctx); - QV4::Scoped o(scope, ctx->d()->callData->thisObject.as()); + QV4::Scoped o(scope, ctx->thisObject().as()); if (!o) return ctx->engine()->throwTypeError(QStringLiteral("Not a valid VisualData object")); - if (!ctx->d()->callData->argc) + if (!ctx->argc()) return ctx->engine()->throwTypeError(); if (!o->d()->item->metaType->model) return QV4::Encode::undefined(); QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(o->d()->item->metaType->model); - const int groupFlags = model->m_cacheMetaType->parseGroups(ctx->d()->callData->args[0]); + const int groupFlags = model->m_cacheMetaType->parseGroups(ctx->args()[0]); const int cacheIndex = model->m_cache.indexOf(o->d()->item); Compositor::iterator it = model->m_compositor.find(Compositor::Cache, cacheIndex); model->setGroups(it, 1, Compositor::Cache, groupFlags); @@ -3236,21 +3236,21 @@ struct QQmlDelegateModelGroupChange : QV4::Object static QV4::ReturnedValue method_get_index(QV4::CallContext *ctx) { QV4::Scope scope(ctx); - QV4::Scoped that(scope, ctx->d()->callData->thisObject.as()); + QV4::Scoped that(scope, ctx->thisObject().as()); if (!that) return ctx->engine()->throwTypeError(); return QV4::Encode(that->d()->change.index); } static QV4::ReturnedValue method_get_count(QV4::CallContext *ctx) { QV4::Scope scope(ctx); - QV4::Scoped that(scope, ctx->d()->callData->thisObject.as()); + QV4::Scoped that(scope, ctx->thisObject().as()); if (!that) return ctx->engine()->throwTypeError(); return QV4::Encode(that->d()->change.count); } static QV4::ReturnedValue method_get_moveId(QV4::CallContext *ctx) { QV4::Scope scope(ctx); - QV4::Scoped that(scope, ctx->d()->callData->thisObject.as()); + QV4::Scoped that(scope, ctx->thisObject().as()); if (!that) return ctx->engine()->throwTypeError(); if (that->d()->change.moveId < 0) -- cgit v1.2.3