diff options
author | Lars Knoll <lars.knoll@theqtcompany.com> | 2014-12-31 13:21:39 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2015-01-08 22:08:55 +0100 |
commit | a6c36616b0ccf9c1aeb71d90437c9226ae76fe10 (patch) | |
tree | 5c8e796b9fe6f15c08bd20dc20d084976c75845b /src/imports | |
parent | fbf674e566032121d6d0a865dbff2a5dac2b3f0d (diff) |
Move extension mechanism over to use the v4 engine
Change-Id: Ib329fc7bcae3c78d962a116f53b2244a71f81228
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/imports')
-rw-r--r-- | src/imports/localstorage/plugin.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/imports/localstorage/plugin.cpp b/src/imports/localstorage/plugin.cpp index 7c7989a9f4..0ada149a63 100644 --- a/src/imports/localstorage/plugin.cpp +++ b/src/imports/localstorage/plugin.cpp @@ -82,7 +82,7 @@ QT_BEGIN_NAMESPACE class QQmlSqlDatabaseData : public QV8Engine::Deletable { public: - QQmlSqlDatabaseData(QV8Engine *engine); + QQmlSqlDatabaseData(QV4::ExecutionEngine *engine); ~QQmlSqlDatabaseData(); QV4::PersistentValue databaseProto; @@ -90,7 +90,7 @@ public: QV4::PersistentValue rowsProto; }; -V8_DEFINE_EXTENSION(QQmlSqlDatabaseData, databaseData) +V4_DEFINE_EXTENSION(QQmlSqlDatabaseData, databaseData) namespace QV4 { @@ -318,7 +318,7 @@ static ReturnedValue qmlsqldatabase_executeSql(CallContext *ctx) } if (query.exec()) { QV4::Scoped<QQmlSqlDatabaseWrapper> rows(scope, QQmlSqlDatabaseWrapper::create(engine)); - QV4::ScopedObject p(scope, databaseData(engine)->rowsProto.value()); + QV4::ScopedObject p(scope, databaseData(scope.engine)->rowsProto.value()); rows->setPrototype(p.getPointer()); rows->d()->type = Heap::QQmlSqlDatabaseWrapper::Rows; rows->d()->database = db; @@ -395,7 +395,7 @@ static ReturnedValue qmlsqldatabase_changeVersion(CallContext *ctx) V4THROW_SQL(SQLEXCEPTION_VERSION_ERR, QQmlEngine::tr("Version mismatch: expected %1, found %2").arg(from_version).arg(r->d()->version)); Scoped<QQmlSqlDatabaseWrapper> w(scope, QQmlSqlDatabaseWrapper::create(engine)); - ScopedObject p(scope, databaseData(engine)->queryProto.value()); + ScopedObject p(scope, databaseData(scope.engine)->queryProto.value()); w->setPrototype(p.getPointer()); w->d()->type = Heap::QQmlSqlDatabaseWrapper::Query; w->d()->database = db; @@ -448,7 +448,7 @@ static ReturnedValue qmlsqldatabase_transaction_shared(CallContext *ctx, bool re QSqlDatabase db = r->d()->database; Scoped<QQmlSqlDatabaseWrapper> w(scope, QQmlSqlDatabaseWrapper::create(engine)); - QV4::ScopedObject p(scope, databaseData(engine)->queryProto.value()); + QV4::ScopedObject p(scope, databaseData(scope.engine)->queryProto.value()); w->setPrototype(p.getPointer()); w->d()->type = Heap::QQmlSqlDatabaseWrapper::Query; w->d()->database = db; @@ -481,9 +481,8 @@ static ReturnedValue qmlsqldatabase_read_transaction(CallContext *ctx) return qmlsqldatabase_transaction_shared(ctx, true); } -QQmlSqlDatabaseData::QQmlSqlDatabaseData(QV8Engine *engine) +QQmlSqlDatabaseData::QQmlSqlDatabaseData(ExecutionEngine *v4) { - ExecutionEngine *v4 = QV8Engine::getV4(engine); Scope scope(v4); { ScopedObject proto(scope, v4->newObject()); @@ -726,7 +725,7 @@ void QQuickLocalStorage::openDatabaseSync(QQmlV4Function *args) } QV4::Scoped<QQmlSqlDatabaseWrapper> db(scope, QQmlSqlDatabaseWrapper::create(engine)); - QV4::ScopedObject p(scope, databaseData(engine)->databaseProto.value()); + QV4::ScopedObject p(scope, databaseData(scope.engine)->databaseProto.value()); db->setPrototype(p.getPointer()); db->d()->database = database; db->d()->version = version; |