diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-24 15:25:10 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-26 09:05:32 +0200 |
commit | 74807c0725ad6ef6ccd49611bb9f4f994cddf106 (patch) | |
tree | 9f1d08155a46bdbef45390b3a017ea6f7a430700 /src/imports | |
parent | 9062476491dd1c81f63bb7a3ae6e6a080db1db1e (diff) |
Move more API over to use ValueRef
Change-Id: I372f1f3e3e78d45912a913f437e622e0acfc9646
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/imports')
-rw-r--r-- | src/imports/localstorage/plugin.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/imports/localstorage/plugin.cpp b/src/imports/localstorage/plugin.cpp index d4966da9c8..739d37bb39 100644 --- a/src/imports/localstorage/plugin.cpp +++ b/src/imports/localstorage/plugin.cpp @@ -270,12 +270,13 @@ static ReturnedValue qmlsqldatabase_executeSql(SimpleCallContext *ctx) if (query.prepare(sql)) { if (ctx->argumentCount > 1) { - Value values = ctx->arguments[1]; - if (ArrayObject *array = values.asArrayObject()) { + ScopedValue values(scope, ctx->arguments[1]); + if (ArrayObject *array = values->asArrayObject()) { quint32 size = array->arrayLength(); + QV4::ScopedValue v(scope); for (quint32 ii = 0; ii < size; ++ii) - query.bindValue(ii, engine->toVariant(QV4::Value::fromReturnedValue(array->getIndexed(ii)), -1)); - } else if (Object *object = values.asObject()) { + query.bindValue(ii, engine->toVariant((v = array->getIndexed(ii)), -1)); + } else if (Object *object = values->asObject()) { ObjectIterator it(object, ObjectIterator::WithProtoChain|ObjectIterator::EnumerableOnly); ScopedValue key(scope); while (1) { @@ -283,7 +284,8 @@ static ReturnedValue qmlsqldatabase_executeSql(SimpleCallContext *ctx) key = it.nextPropertyName(&value); if (key->isNull()) break; - QVariant v = engine->toVariant(value, -1); + QV4::ScopedValue val(scope, value); + QVariant v = engine->toVariant(val, -1); if (key->isString()) { query.bindValue(key->stringValue()->toQString(), v); } else { |