diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-25 12:24:36 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-28 13:33:24 +0200 |
commit | cf2a253f2f60c9f0c61682527d80143e72b355d4 (patch) | |
tree | d60e8be50437e6f15513e25155817b902a2062c7 /src/imports | |
parent | 7872b380063d0497ba62fecfdc92148f1ea947af (diff) |
Move Value::fromBool, ... to a new Primitive class
This will simplify finding the remaining direct usages of
QV4::Value that need fixing.
Change-Id: I223099727436d5748027c84c53d9dfc4028e38ed
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/imports')
-rw-r--r-- | src/imports/dialogs-private/qquickfontlistmodel.cpp | 2 | ||||
-rw-r--r-- | src/imports/localstorage/plugin.cpp | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/imports/dialogs-private/qquickfontlistmodel.cpp b/src/imports/dialogs-private/qquickfontlistmodel.cpp index 9d3b90f4d9..327f214145 100644 --- a/src/imports/dialogs-private/qquickfontlistmodel.cpp +++ b/src/imports/dialogs-private/qquickfontlistmodel.cpp @@ -241,7 +241,7 @@ QQmlV4Handle QQuickFontListModel::pointSizes() a->arrayReserve(size); a->arrayDataLen = size; for (int i = 0; i < size; ++i) - a->arrayData[i].value = Value::fromInt32(pss.at(i)); + a->arrayData[i].value = Primitive::fromInt32(pss.at(i)); a->setArrayLengthUnchecked(size); return QQmlV4Handle(ScopedValue(scope, a.asReturnedValue())); diff --git a/src/imports/localstorage/plugin.cpp b/src/imports/localstorage/plugin.cpp index 4ca0222cf4..fdce3fe99e 100644 --- a/src/imports/localstorage/plugin.cpp +++ b/src/imports/localstorage/plugin.cpp @@ -67,7 +67,7 @@ using namespace QV4; #define V4THROW_SQL(error, desc) { \ QV4::Scoped<String> v(scope, Value::fromString(ctx, desc)); \ QV4::Scoped<Object> ex(scope, ctx->engine->newErrorObject(v.asValue())); \ - ex->put(QV4::ScopedString(scope, ctx->engine->newIdentifier(QStringLiteral("code"))), QV4::ScopedValue(scope, Value::fromInt32(error))); \ + ex->put(QV4::ScopedString(scope, ctx->engine->newIdentifier(QStringLiteral("code"))), QV4::ScopedValue(scope, Primitive::fromInt32(error))); \ ctx->throwError(ex); \ } @@ -263,7 +263,7 @@ static ReturnedValue qmlsqldatabase_executeSql(SimpleCallContext *ctx) QSqlQuery query(db); bool err = false; - ScopedValue result(scope, Value::undefinedValue()); + ScopedValue result(scope, Primitive::undefinedValue()); if (query.prepare(sql)) { if (ctx->callData->argc > 1) { @@ -307,7 +307,7 @@ static ReturnedValue qmlsqldatabase_executeSql(SimpleCallContext *ctx) // XXX optimize ScopedString s(scope); ScopedValue v(scope); - resultObject->put((s = ctx->engine->newIdentifier("rowsAffected")), (v = Value::fromInt32(query.numRowsAffected()))); + resultObject->put((s = ctx->engine->newIdentifier("rowsAffected")), (v = Primitive::fromInt32(query.numRowsAffected()))); resultObject->put((s = ctx->engine->newIdentifier("insertId")), (v = engine->toString(query.lastInsertId().toString()))); resultObject->put((s = ctx->engine->newIdentifier("rows")), (v = Value::fromObject(rows))); } else { |