From 74807c0725ad6ef6ccd49611bb9f4f994cddf106 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 24 Sep 2013 15:25:10 +0200 Subject: Move more API over to use ValueRef Change-Id: I372f1f3e3e78d45912a913f437e622e0acfc9646 Reviewed-by: Simon Hausmann --- src/imports/localstorage/plugin.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/imports') 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 { -- cgit v1.2.3