aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/types/qqmldelegatemodel.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2014-07-28 10:07:57 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2014-11-04 20:17:54 +0100
commit486948817b26da2c62802bb93a0f671715c609d4 (patch)
tree45cd51615a6d187ac504c18c4dee4aa31cf9a771 /src/qml/types/qqmldelegatemodel.cpp
parent6f6b350976ccfe959223b1fbe8c21fe71efc45bd (diff)
Move the throw methods from ExecutionContext to ExecutionEngine
The methods don't require a context, and thus shouldn't be implemented there. Change-Id: If058e0c5067093a4161f2275ac4288aa2bc500f3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/types/qqmldelegatemodel.cpp')
-rw-r--r--src/qml/types/qqmldelegatemodel.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp
index fee1392c44..e150545926 100644
--- a/src/qml/types/qqmldelegatemodel.cpp
+++ b/src/qml/types/qqmldelegatemodel.cpp
@@ -75,7 +75,7 @@ struct DelegateModelGroupFunction: QV4::FunctionObject
static QV4::ReturnedValue construct(QV4::Managed *m, QV4::CallData *)
{
- return m->engine()->currentContext()->throwTypeError();
+ return m->engine()->throwTypeError();
}
static QV4::ReturnedValue call(QV4::Managed *that, QV4::CallData *callData)
@@ -85,7 +85,7 @@ struct DelegateModelGroupFunction: QV4::FunctionObject
QV4::Scoped<DelegateModelGroupFunction> f(scope, that, QV4::Scoped<DelegateModelGroupFunction>::Cast);
QV4::Scoped<QQmlDelegateModelItemObject> o(scope, callData->thisObject);
if (!o)
- return v4->currentContext()->throwTypeError(QStringLiteral("Not a valid VisualData object"));
+ return v4->throwTypeError(QStringLiteral("Not a valid VisualData object"));
QV4::ScopedValue v(scope, callData->argument(0));
return f->d()->code(o->d()->item, f->d()->flag, v);
@@ -1781,7 +1781,7 @@ QV4::ReturnedValue QQmlDelegateModelItem::get_model(QV4::CallContext *ctx)
QV4::Scope scope(ctx);
QV4::Scoped<QQmlDelegateModelItemObject> o(scope, ctx->d()->callData->thisObject.as<QQmlDelegateModelItemObject>());
if (!o)
- return ctx->throwTypeError(QStringLiteral("Not a valid VisualData object"));
+ return ctx->engine()->throwTypeError(QStringLiteral("Not a valid VisualData object"));
if (!o->d()->item->metaType->model)
return QV4::Encode::undefined();
@@ -1793,7 +1793,7 @@ QV4::ReturnedValue QQmlDelegateModelItem::get_groups(QV4::CallContext *ctx)
QV4::Scope scope(ctx);
QV4::Scoped<QQmlDelegateModelItemObject> o(scope, ctx->d()->callData->thisObject.as<QQmlDelegateModelItemObject>());
if (!o)
- return ctx->throwTypeError(QStringLiteral("Not a valid VisualData object"));
+ return ctx->engine()->throwTypeError(QStringLiteral("Not a valid VisualData object"));
QStringList groups;
for (int i = 1; i < o->d()->item->metaType->groupCount; ++i) {
@@ -1809,9 +1809,9 @@ QV4::ReturnedValue QQmlDelegateModelItem::set_groups(QV4::CallContext *ctx)
QV4::Scope scope(ctx);
QV4::Scoped<QQmlDelegateModelItemObject> o(scope, ctx->d()->callData->thisObject.as<QQmlDelegateModelItemObject>());
if (!o)
- return ctx->throwTypeError(QStringLiteral("Not a valid VisualData object"));
+ return ctx->engine()->throwTypeError(QStringLiteral("Not a valid VisualData object"));
if (!ctx->d()->callData->argc)
- return ctx->throwTypeError();
+ return ctx->engine()->throwTypeError();
if (!o->d()->item->metaType->model)
return QV4::Encode::undefined();
@@ -3229,21 +3229,21 @@ struct QQmlDelegateModelGroupChange : QV4::Object
QV4::Scope scope(ctx);
QV4::Scoped<QQmlDelegateModelGroupChange> that(scope, ctx->d()->callData->thisObject.as<QQmlDelegateModelGroupChange>());
if (!that)
- return ctx->throwTypeError();
+ 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<QQmlDelegateModelGroupChange> that(scope, ctx->d()->callData->thisObject.as<QQmlDelegateModelGroupChange>());
if (!that)
- return ctx->throwTypeError();
+ 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<QQmlDelegateModelGroupChange> that(scope, ctx->d()->callData->thisObject.as<QQmlDelegateModelGroupChange>());
if (!that)
- return ctx->throwTypeError();
+ return ctx->engine()->throwTypeError();
if (that->d()->change.moveId < 0)
return QV4::Encode::undefined();
return QV4::Encode(that->d()->change.moveId);