diff options
author | Lars Knoll <lars.knoll@theqtcompany.com> | 2015-01-02 15:07:35 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@digia.com> | 2015-01-09 10:27:57 +0100 |
commit | ca977a0c8fa25d5df4dbddba08bc2fb022df7c1c (patch) | |
tree | 24953329bba5bbb7ea8611d09098b8a6c8ba39c3 /src/imports/localstorage/plugin.cpp | |
parent | 7041eb353a4ad416f51245cc17342e16b3a02a9b (diff) |
Cleanup variant conversion code
Make public methods proper members of the ExecutionEngine, and
move private methods into the .cpp file only.
Change-Id: I3ca49e39bb1c4e559a2c63346e6ae6cfa446147d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/imports/localstorage/plugin.cpp')
-rw-r--r-- | src/imports/localstorage/plugin.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/imports/localstorage/plugin.cpp b/src/imports/localstorage/plugin.cpp index 726b7d8874..84b0b2387a 100644 --- a/src/imports/localstorage/plugin.cpp +++ b/src/imports/localstorage/plugin.cpp @@ -226,7 +226,7 @@ static ReturnedValue qmlsqldatabase_rows_index(QQmlSqlDatabaseWrapper *r, Execut for (int ii = 0; ii < record.count(); ++ii) { QVariant v = record.value(ii); ScopedString s(scope, v4->newIdentifier(record.fieldName(ii))); - ScopedValue val(scope, v.isNull() ? Encode::null() : QV4::ExecutionEngine::fromVariant(v4, v)); + ScopedValue val(scope, v.isNull() ? Encode::null() : v4->fromVariant(v)); row->put(s.getPointer(), val); } if (hasProperty) @@ -291,7 +291,7 @@ static ReturnedValue qmlsqldatabase_executeSql(CallContext *ctx) quint32 size = array->getLength(); QV4::ScopedValue v(scope); for (quint32 ii = 0; ii < size; ++ii) - query.bindValue(ii, QV4::ExecutionEngine::toVariant(scope.engine, (v = array->getIndexed(ii)), -1)); + query.bindValue(ii, scope.engine->toVariant((v = array->getIndexed(ii)), -1)); } else if (values->asObject()) { ScopedObject object(scope, values); ObjectIterator it(scope, object, ObjectIterator::WithProtoChain|ObjectIterator::EnumerableOnly); @@ -301,7 +301,7 @@ static ReturnedValue qmlsqldatabase_executeSql(CallContext *ctx) key = it.nextPropertyName(val); if (key->isNull()) break; - QVariant v = QV4::ExecutionEngine::toVariant(scope.engine, val, -1); + QVariant v = scope.engine->toVariant(val, -1); if (key->isString()) { query.bindValue(key->stringValue()->toQString(), v); } else { @@ -310,7 +310,7 @@ static ReturnedValue qmlsqldatabase_executeSql(CallContext *ctx) } } } else { - query.bindValue(0, QV4::ExecutionEngine::toVariant(scope.engine, values, -1)); + query.bindValue(0, scope.engine->toVariant(values, -1)); } } if (query.exec()) { |