aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/util
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-09-12 11:13:03 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-18 13:13:47 +0200
commit16f92ad85cf665d863ded5eeaaa7fc3f90820b3f (patch)
tree74b3477b9d6c023730835f1c478ceb6eaec68a2b /src/qml/util
parent7d4e61dd824706984030c58684fa844ff9cde251 (diff)
Convert builtin methods to return a ReturnedValue
Change-Id: I6b75adbf53a5be0deab023d2eed98ce2a7915551 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/util')
-rw-r--r--src/qml/util/qqmladaptormodel.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/qml/util/qqmladaptormodel.cpp b/src/qml/util/qqmladaptormodel.cpp
index ffd9de0e16..b64a393bd3 100644
--- a/src/qml/util/qqmladaptormodel.cpp
+++ b/src/qml/util/qqmladaptormodel.cpp
@@ -63,13 +63,13 @@ public:
V8_DEFINE_EXTENSION(QQmlAdaptorModelEngineData, engineData)
-static QV4::Value get_index(QV4::SimpleCallContext *ctx)
+static QV4::ReturnedValue get_index(QV4::SimpleCallContext *ctx)
{
QQmlDelegateModelItemObject *o = ctx->thisObject.as<QQmlDelegateModelItemObject>();
if (!o)
ctx->throwTypeError(QStringLiteral("Not a valid VisualData object"));
- return QV4::Value::fromInt32(o->item->index);
+ return QV4::Encode(o->item->index);
}
template <typename T, typename M> static void setModelDataType(QMetaObjectBuilder *builder, M *metaType)
@@ -194,7 +194,7 @@ public:
dataType->watchedRoles += newRoles;
}
- static QV4::Value get_hasModelChildren(QV4::SimpleCallContext *ctx)
+ static QV4::ReturnedValue get_hasModelChildren(QV4::SimpleCallContext *ctx)
{
QQmlDelegateModelItemObject *o = ctx->thisObject.as<QQmlDelegateModelItemObject>();
if (!o)
@@ -203,9 +203,9 @@ public:
const QQmlAdaptorModel *const model = static_cast<QQmlDMCachedModelData *>(o->item)->type->model;
if (o->item->index >= 0 && *model) {
const QAbstractItemModel * const aim = model->aim();
- return QV4::Value::fromBoolean(aim->hasChildren(aim->index(o->item->index, 0, model->rootIndex)));
+ return QV4::Encode(aim->hasChildren(aim->index(o->item->index, 0, model->rootIndex)));
} else {
- return QV4::Value::fromBoolean(false);
+ return QV4::Encode(false);
}
}
@@ -578,16 +578,16 @@ public:
}
}
- static QV4::Value get_modelData(QV4::SimpleCallContext *ctx)
+ static QV4::ReturnedValue get_modelData(QV4::SimpleCallContext *ctx)
{
QQmlDelegateModelItemObject *o = ctx->thisObject.as<QQmlDelegateModelItemObject>();
if (!o)
ctx->throwTypeError(QStringLiteral("Not a valid VisualData object"));
- return ctx->engine->v8Engine->fromVariant(static_cast<QQmlDMListAccessorData *>(o->item)->cachedData);
+ return ctx->engine->v8Engine->fromVariant(static_cast<QQmlDMListAccessorData *>(o->item)->cachedData).asReturnedValue();
}
- static QV4::Value set_modelData(QV4::SimpleCallContext *ctx)
+ static QV4::ReturnedValue set_modelData(QV4::SimpleCallContext *ctx)
{
QQmlDelegateModelItemObject *o = ctx->thisObject.as<QQmlDelegateModelItemObject>();
if (!o)
@@ -596,6 +596,7 @@ public:
ctx->throwTypeError();
static_cast<QQmlDMListAccessorData *>(o->item)->setModelData(ctx->engine->v8Engine->toVariant(ctx->arguments[0], QVariant::Invalid));
+ return QV4::Encode::undefined();
}
QV4::Value get()