diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-05-08 16:22:39 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2013-05-08 19:57:01 +0200 |
commit | 995d65f3f4f348757363ba2a3a3c3444aa281b4e (patch) | |
tree | cae5c176847609abc33f51c065aa38b38cd6b9b9 /src/qml/types/qqmllistmodel.cpp | |
parent | 2b0d3bf812273e762e7aa27a58909ade59590c0f (diff) |
Cleanup v8 dependencies from QQmlV8Function
... and rename it to QQmlV4Function
Change-Id: Iad72347babf62691e26306877d4f229fda127eb7
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/types/qqmllistmodel.cpp')
-rw-r--r-- | src/qml/types/qqmllistmodel.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/qml/types/qqmllistmodel.cpp b/src/qml/types/qqmllistmodel.cpp index 23a41d426b..d44773cb78 100644 --- a/src/qml/types/qqmllistmodel.cpp +++ b/src/qml/types/qqmllistmodel.cpp @@ -1894,13 +1894,13 @@ void QQmlListModel::clear() \sa clear() */ -void QQmlListModel::remove(QQmlV8Function *args) +void QQmlListModel::remove(QQmlV4Function *args) { - int argLength = args->Length(); + int argLength = args->length(); if (argLength == 1 || argLength == 2) { - int index = (*args)[0]->Int32Value(); - int removeCount = (argLength == 2 ? ((*args)[1]->Int32Value()) : 1); + int index = (*args)[0].toInt32(); + int removeCount = (argLength == 2 ? (*args)[1].toInt32() : 1); if (index < 0 || index+removeCount > count() || removeCount <= 0) { qmlInfo(this) << tr("remove: indices [%1 - %2] out of range [0 - %3]").arg(index).arg(index+removeCount).arg(count()); @@ -1937,9 +1937,9 @@ void QQmlListModel::remove(QQmlV8Function *args) \sa set(), append() */ -void QQmlListModel::insert(QQmlV8Function *args) +void QQmlListModel::insert(QQmlV4Function *args) { - if (args->Length() == 2) { + if (args->length() == 2) { v8::Handle<v8::Value> arg0 = (*args)[0]; int index = arg0->Int32Value(); @@ -2047,9 +2047,9 @@ void QQmlListModel::move(int from, int to, int n) \sa set(), remove() */ -void QQmlListModel::append(QQmlV8Function *args) +void QQmlListModel::append(QQmlV4Function *args) { - if (args->Length() == 1) { + if (args->length() == 1) { v8::Handle<v8::Value> arg = (*args)[0]; if (arg->IsArray()) { |