From 6c9f1c8ed93374c16ca6ac540f39e98b451be0d8 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 11 Sep 2013 21:48:23 +0200 Subject: Use a ReturnedValue for Managed::getIndexed() Change-Id: I0371ed21c4ef99564d3ffa1082dd109e890a78bf Reviewed-by: Simon Hausmann --- src/imports/localstorage/plugin.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/imports') diff --git a/src/imports/localstorage/plugin.cpp b/src/imports/localstorage/plugin.cpp index 2cb62eb5c0..de89f120bc 100644 --- a/src/imports/localstorage/plugin.cpp +++ b/src/imports/localstorage/plugin.cpp @@ -105,7 +105,7 @@ public: ~QQmlSqlDatabaseWrapper() { } - static Value getIndexed(Managed *m, uint index, bool *hasProperty); + static ReturnedValue getIndexed(Managed *m, uint index, bool *hasProperty); static void destroy(Managed *that) { static_cast(that)->~QQmlSqlDatabaseWrapper(); } @@ -217,13 +217,13 @@ static Value qmlsqldatabase_rows_index(QQmlSqlDatabaseWrapper *r, ExecutionEngin } } -Value QQmlSqlDatabaseWrapper::getIndexed(Managed *m, uint index, bool *hasProperty) +ReturnedValue QQmlSqlDatabaseWrapper::getIndexed(Managed *m, uint index, bool *hasProperty) { QQmlSqlDatabaseWrapper *r = m->as(); if (!r || r->type != QQmlSqlDatabaseWrapper::Rows) return Object::getIndexed(m, index, hasProperty); - return qmlsqldatabase_rows_index(r, m->engine(), index, hasProperty); + return qmlsqldatabase_rows_index(r, m->engine(), index, hasProperty).asReturnedValue(); } static Value qmlsqldatabase_rows_item(SimpleCallContext *ctx) @@ -265,7 +265,7 @@ static Value qmlsqldatabase_executeSql(SimpleCallContext *ctx) if (ArrayObject *array = values.asArrayObject()) { quint32 size = array->arrayLength(); for (quint32 ii = 0; ii < size; ++ii) - query.bindValue(ii, engine->toVariant(array->getIndexed(ii), -1)); + query.bindValue(ii, engine->toVariant(QV4::Value::fromReturnedValue(array->getIndexed(ii)), -1)); } else if (Object *object = values.asObject()) { ObjectIterator it(object, ObjectIterator::WithProtoChain|ObjectIterator::EnumerableOnly); while (1) { -- cgit v1.2.3