From 85069f4315e6f5a26ad78eea1db660cce4db8dd0 Mon Sep 17 00:00:00 2001 From: Charles Yin Date: Thu, 9 Feb 2012 13:00:07 +1000 Subject: [PATCH] Remove deprecated builtin sql database API. The new local storage API has been implemented as a standalone module plugin for a while, and qtquick1 has been moved into a seperated repo, so the old API can be safely removed now. Task-number:QTBUG-21538 Change-Id: Ib89f34797afe492ad4987d5afa8ff23cdca044ab Reviewed-by: Martin Jones Reviewed-by: Michael Brasser --- src/declarative/qml/qdeclarativeengine.cpp | 1 - src/declarative/qml/qdeclarativesqldatabase.cpp | 550 ------------------------ src/declarative/qml/qdeclarativesqldatabase_p.h | 69 --- src/declarative/qml/qml.pri | 4 +- src/declarative/qml/v8/qv8engine.cpp | 7 +- src/declarative/qml/v8/qv8engine_p.h | 2 - 6 files changed, 2 insertions(+), 631 deletions(-) delete mode 100644 src/declarative/qml/qdeclarativesqldatabase.cpp delete mode 100644 src/declarative/qml/qdeclarativesqldatabase_p.h diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index 6097fd4..9118ef4 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -54,7 +54,6 @@ #include #include "qdeclarativestringconverters_p.h" #include "qdeclarativexmlhttprequest_p.h" -#include "qdeclarativesqldatabase_p.h" #include "qdeclarativescriptstring.h" #include "qdeclarativeglobal_p.h" #include "qdeclarativelistmodel_p.h" diff --git a/src/declarative/qml/qdeclarativesqldatabase.cpp b/src/declarative/qml/qdeclarativesqldatabase.cpp deleted file mode 100644 index f47fe14..0000000 --- a/src/declarative/qml/qdeclarativesqldatabase.cpp +++ /dev/null @@ -1,550 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qdeclarativesqldatabase_p.h" - -#include "qdeclarativeengine.h" -#include "qdeclarativeengine_p.h" -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -QT_BEGIN_NAMESPACE - - -#define THROW_SQL(error, desc) - -#define V8THROW_SQL(error, desc) \ -{ \ - v8::Local v = v8::Exception::Error(engine->toString(desc)); \ - v->ToObject()->Set(v8::String::New("code"), v8::Integer::New(error)); \ - v8::ThrowException(v); \ - return v8::Handle(); \ -} - -#define V8THROW_REFERENCE(string) { \ - v8::ThrowException(v8::Exception::ReferenceError(v8::String::New(string))); \ - return v8::Handle(); \ -} - -#define V8THROW_REFERENCE_VOID(string) { \ - v8::ThrowException(v8::Exception::ReferenceError(v8::String::New(string))); \ - return; \ -} - -struct QDeclarativeSqlDatabaseData { - QDeclarativeSqlDatabaseData(QV8Engine *engine); - ~QDeclarativeSqlDatabaseData(); - - v8::Persistent constructor; - v8::Persistent queryConstructor; - v8::Persistent rowsConstructor; - - static inline QDeclarativeSqlDatabaseData *data(QV8Engine *e) { - return (QDeclarativeSqlDatabaseData *)e->sqlDatabaseData(); - } - static inline QDeclarativeSqlDatabaseData *data(void *d) { - return (QDeclarativeSqlDatabaseData *)d; - } -}; - -class QV8SqlDatabaseResource : public QV8ObjectResource -{ - V8_RESOURCE_TYPE(SQLDatabaseType) - -public: - enum Type { Database, Query, Rows }; - - QV8SqlDatabaseResource(QV8Engine *e) - : QV8ObjectResource(e), type(Database), inTransaction(false), readonly(false), forwardOnly(false) {} - - Type type; - QSqlDatabase database; - - QString version; // type == Database - - bool inTransaction; // type == Query - bool readonly; // type == Query - - QSqlQuery query; // type == Rows - bool forwardOnly; // type == Rows -}; - -static v8::Handle qmlsqldatabase_version(v8::Local /* property */, const v8::AccessorInfo& info) -{ - QV8SqlDatabaseResource *r = v8_resource_cast(info.This()); - if (!r || r->type != QV8SqlDatabaseResource::Database) - V8THROW_REFERENCE("Not a SQLDatabase object"); - - return r->engine->toString(r->version); -} - -static v8::Handle qmlsqldatabase_rows_length(v8::Local /* property */, const v8::AccessorInfo& info) -{ - QV8SqlDatabaseResource *r = v8_resource_cast(info.This()); - if (!r || r->type != QV8SqlDatabaseResource::Rows) - V8THROW_REFERENCE("Not a SQLDatabase::Rows object"); - - int s = r->query.size(); - if (s < 0) { - // Inefficient - if (r->query.last()) { - s = r->query.at() + 1; - } else { - s = 0; - } - } - return v8::Integer::New(s); -} - -static v8::Handle qmlsqldatabase_rows_forwardOnly(v8::Local /* property */, - const v8::AccessorInfo& info) -{ - QV8SqlDatabaseResource *r = v8_resource_cast(info.This()); - if (!r || r->type != QV8SqlDatabaseResource::Rows) - V8THROW_REFERENCE("Not a SQLDatabase::Rows object"); - - return v8::Boolean::New(r->query.isForwardOnly()); -} - -static void qmlsqldatabase_rows_setForwardOnly(v8::Local /* property */, - v8::Local value, - const v8::AccessorInfo& info) -{ - QV8SqlDatabaseResource *r = v8_resource_cast(info.This()); - if (!r || r->type != QV8SqlDatabaseResource::Rows) - V8THROW_REFERENCE_VOID("Not a SQLDatabase::Rows object"); - - r->query.setForwardOnly(value->BooleanValue()); -} - -QDeclarativeSqlDatabaseData::~QDeclarativeSqlDatabaseData() -{ - qPersistentDispose(constructor); - qPersistentDispose(queryConstructor); - qPersistentDispose(rowsConstructor); -} - -static QString qmlsqldatabase_databasesPath(QV8Engine *engine) -{ - return engine->engine()->offlineStoragePath() + - QDir::separator() + QLatin1String("Databases"); -} - -static void qmlsqldatabase_initDatabasesPath(QV8Engine *engine) -{ - QDir().mkpath(qmlsqldatabase_databasesPath(engine)); -} - -static QString qmlsqldatabase_databaseFile(const QString& connectionName, QV8Engine *engine) -{ - return qmlsqldatabase_databasesPath(engine) + QDir::separator() + connectionName; -} - -static v8::Handle qmlsqldatabase_rows_index(QV8SqlDatabaseResource *r, uint32_t index) -{ - if (r->query.at() == (int)index || r->query.seek(index)) { - - QSqlRecord record = r->query.record(); - // XXX optimize - v8::Local row = v8::Object::New(); - for (int ii = 0; ii < record.count(); ++ii) { - QVariant v = record.value(ii); - if (v.isNull()) { - row->Set(r->engine->toString(record.fieldName(ii)), v8::Null()); - } else { - row->Set(r->engine->toString(record.fieldName(ii)), - r->engine->fromVariant(v)); - } - } - return row; - } else { - return v8::Undefined(); - } -} - -static v8::Handle qmlsqldatabase_rows_index(uint32_t index, const v8::AccessorInfo& info) -{ - QV8SqlDatabaseResource *r = v8_resource_cast(info.This()); - if (!r || r->type != QV8SqlDatabaseResource::Rows) - V8THROW_REFERENCE("Not a SQLDatabase::Rows object"); - - return qmlsqldatabase_rows_index(r, index); -} - -static v8::Handle qmlsqldatabase_rows_item(const v8::Arguments& args) -{ - QV8SqlDatabaseResource *r = v8_resource_cast(args.This()); - if (!r || r->type != QV8SqlDatabaseResource::Rows) - V8THROW_REFERENCE("Not a SQLDatabase::Rows object"); - - return qmlsqldatabase_rows_index(r, args.Length()?args[0]->Uint32Value():0); -} - -static v8::Handle qmlsqldatabase_executeSql(const v8::Arguments& args) -{ - QV8SqlDatabaseResource *r = v8_resource_cast(args.This()); - if (!r || r->type != QV8SqlDatabaseResource::Query) - V8THROW_REFERENCE("Not a SQLDatabase::Query object"); - - QV8Engine *engine = r->engine; - - if (!r->inTransaction) - V8THROW_SQL(SQLEXCEPTION_DATABASE_ERR,QDeclarativeEngine::tr("executeSql called outside transaction()")); - - QSqlDatabase db = r->database; - - QString sql = engine->toString(args[0]); - - if (r->readonly && !sql.startsWith(QLatin1String("SELECT"),Qt::CaseInsensitive)) { - V8THROW_SQL(SQLEXCEPTION_SYNTAX_ERR, QDeclarativeEngine::tr("Read-only Transaction")); - } - - QSqlQuery query(db); - bool err = false; - - v8::Handle result = v8::Undefined(); - - if (query.prepare(sql)) { - if (args.Length() > 1) { - v8::Local values = args[1]; - if (values->IsArray()) { - v8::Local array = v8::Local::Cast(values); - uint32_t size = array->Length(); - for (uint32_t ii = 0; ii < size; ++ii) - query.bindValue(ii, engine->toVariant(array->Get(ii), -1)); - } else if (values->IsObject() && !values->ToObject()->GetExternalResource()) { - v8::Local object = values->ToObject(); - v8::Local names = object->GetPropertyNames(); - uint32_t size = names->Length(); - for (uint32_t ii = 0; ii < size; ++ii) - query.bindValue(engine->toString(names->Get(ii)), - engine->toVariant(object->Get(names->Get(ii)), -1)); - } else { - query.bindValue(0, engine->toVariant(values, -1)); - } - } - if (query.exec()) { - v8::Handle rows = QDeclarativeSqlDatabaseData::data(engine)->rowsConstructor->NewInstance(); - QV8SqlDatabaseResource *r = new QV8SqlDatabaseResource(engine); - r->type = QV8SqlDatabaseResource::Rows; - r->database = db; - r->query = query; - rows->SetExternalResource(r); - - v8::Local resultObject = v8::Object::New(); - result = resultObject; - // XXX optimize - resultObject->Set(v8::String::New("rowsAffected"), v8::Integer::New(query.numRowsAffected())); - resultObject->Set(v8::String::New("insertId"), engine->toString(query.lastInsertId().toString())); - resultObject->Set(v8::String::New("rows"), rows); - } else { - err = true; - } - } else { - err = true; - } - if (err) - V8THROW_SQL(SQLEXCEPTION_DATABASE_ERR,query.lastError().text()); - - return result; -} - -static v8::Handle qmlsqldatabase_changeVersion(const v8::Arguments& args) -{ - if (args.Length() < 2) - return v8::Undefined(); - - QV8SqlDatabaseResource *r = v8_resource_cast(args.This()); - if (!r || r->type != QV8SqlDatabaseResource::Database) - V8THROW_REFERENCE("Not a SQLDatabase object"); - - QV8Engine *engine = r->engine; - - QSqlDatabase db = r->database; - QString from_version = engine->toString(args[0]); - QString to_version = engine->toString(args[1]); - v8::Handle callback = args[2]; - - if (from_version != r->version) - V8THROW_SQL(SQLEXCEPTION_VERSION_ERR, QDeclarativeEngine::tr("Version mismatch: expected %1, found %2").arg(from_version).arg(r->version)); - - v8::Local instance = QDeclarativeSqlDatabaseData::data(engine)->queryConstructor->NewInstance(); - QV8SqlDatabaseResource *r2 = new QV8SqlDatabaseResource(engine); - r2->type = QV8SqlDatabaseResource::Query; - r2->database = db; - r2->version = r->version; - r2->inTransaction = true; - instance->SetExternalResource(r2); - - bool ok = true; - if (callback->IsFunction()) { - ok = false; - db.transaction(); - - v8::TryCatch tc; - v8::Handle callbackArgs[] = { instance }; - v8::Handle::Cast(callback)->Call(engine->global(), 1, callbackArgs); - - if (tc.HasCaught()) { - db.rollback(); - tc.ReThrow(); - return v8::Handle(); - } else if (!db.commit()) { - db.rollback(); - V8THROW_SQL(SQLEXCEPTION_UNKNOWN_ERR,QDeclarativeEngine::tr("SQL transaction failed")); - } else { - ok = true; - } - } - - r2->inTransaction = false; - - if (ok) { - r2->version = to_version; -#ifndef QT_NO_SETTINGS - QSettings ini(qmlsqldatabase_databaseFile(db.connectionName(),engine) + QLatin1String(".ini"), QSettings::IniFormat); - ini.setValue(QLatin1String("Version"), to_version); -#endif - } - - return v8::Undefined(); -} - -static v8::Handle qmlsqldatabase_transaction_shared(const v8::Arguments& args, bool readOnly) -{ - QV8SqlDatabaseResource *r = v8_resource_cast(args.This()); - if (!r || r->type != QV8SqlDatabaseResource::Database) - V8THROW_REFERENCE("Not a SQLDatabase object"); - - QV8Engine *engine = r->engine; - - if (args.Length() == 0 || !args[0]->IsFunction()) - V8THROW_SQL(SQLEXCEPTION_UNKNOWN_ERR,QDeclarativeEngine::tr("transaction: missing callback")); - - QSqlDatabase db = r->database; - v8::Handle callback = v8::Handle::Cast(args[0]); - - v8::Local instance = QDeclarativeSqlDatabaseData::data(engine)->queryConstructor->NewInstance(); - QV8SqlDatabaseResource *q = new QV8SqlDatabaseResource(engine); - q->type = QV8SqlDatabaseResource::Query; - q->database = db; - q->readonly = readOnly; - q->inTransaction = true; - instance->SetExternalResource(q); - - db.transaction(); - v8::TryCatch tc; - v8::Handle callbackArgs[] = { instance }; - callback->Call(engine->global(), 1, callbackArgs); - - q->inTransaction = false; - - if (tc.HasCaught()) { - db.rollback(); - tc.ReThrow(); - return v8::Handle(); - } else if (!db.commit()) { - db.rollback(); - } - - return v8::Undefined(); -} - -static v8::Handle qmlsqldatabase_transaction(const v8::Arguments& args) -{ - return qmlsqldatabase_transaction_shared(args, false); -} - -static v8::Handle qmlsqldatabase_read_transaction(const v8::Arguments& args) -{ - return qmlsqldatabase_transaction_shared(args, true); -} - -/* - Currently documented in doc/src/declarative/globalobject.qdoc -*/ -static v8::Handle qmlsqldatabase_open_sync(const v8::Arguments& args) -{ -#ifndef QT_NO_SETTINGS - QV8Engine *engine = V8ENGINE(); - qmlsqldatabase_initDatabasesPath(engine); - - QSqlDatabase database; - - QString dbname = engine->toString(args[0]); - QString dbversion = engine->toString(args[1]); - QString dbdescription = engine->toString(args[2]); - int dbestimatedsize = args[3]->Int32Value(); - v8::Handle dbcreationCallback = args[4]; - - QCryptographicHash md5(QCryptographicHash::Md5); - md5.addData(dbname.toUtf8()); - QString dbid(QLatin1String(md5.result().toHex())); - - QString basename = qmlsqldatabase_databaseFile(dbid, engine); - bool created = false; - QString version = dbversion; - - { - QSettings ini(basename+QLatin1String(".ini"),QSettings::IniFormat); - - if (QSqlDatabase::connectionNames().contains(dbid)) { - database = QSqlDatabase::database(dbid); - version = ini.value(QLatin1String("Version")).toString(); - if (version != dbversion && !dbversion.isEmpty() && !version.isEmpty()) - V8THROW_SQL(SQLEXCEPTION_VERSION_ERR, QDeclarativeEngine::tr("SQL: database version mismatch")); - } else { - created = !QFile::exists(basename+QLatin1String(".sqlite")); - database = QSqlDatabase::addDatabase(QLatin1String("QSQLITE"), dbid); - if (created) { - ini.setValue(QLatin1String("Name"), dbname); - if (dbcreationCallback->IsFunction()) - version = QString(); - ini.setValue(QLatin1String("Version"), version); - ini.setValue(QLatin1String("Description"), dbdescription); - ini.setValue(QLatin1String("EstimatedSize"), dbestimatedsize); - ini.setValue(QLatin1String("Driver"), QLatin1String("QSQLITE")); - } else { - if (!dbversion.isEmpty() && ini.value(QLatin1String("Version")) != dbversion) { - // Incompatible - V8THROW_SQL(SQLEXCEPTION_VERSION_ERR,QDeclarativeEngine::tr("SQL: database version mismatch")); - } - version = ini.value(QLatin1String("Version")).toString(); - } - database.setDatabaseName(basename+QLatin1String(".sqlite")); - } - if (!database.isOpen()) - database.open(); - } - - v8::Local instance = QDeclarativeSqlDatabaseData::data(engine)->constructor->NewInstance(); - QV8SqlDatabaseResource *r = new QV8SqlDatabaseResource(engine); - r->database = database; - r->version = version; - instance->SetExternalResource(r); - - if (created && dbcreationCallback->IsFunction()) { - v8::TryCatch tc; - v8::Handle callback = v8::Handle::Cast(dbcreationCallback); - v8::Handle args[] = { instance }; - callback->Call(engine->global(), 1, args); - if (tc.HasCaught()) { - tc.ReThrow(); - return v8::Handle(); - } - } - - return instance; -#else - return v8::Undefined(); -#endif // QT_NO_SETTINGS -} - -QDeclarativeSqlDatabaseData::QDeclarativeSqlDatabaseData(QV8Engine *engine) -{ - { - v8::Local ft = v8::FunctionTemplate::New(); - ft->InstanceTemplate()->SetHasExternalResource(true); - ft->PrototypeTemplate()->Set(v8::String::New("transaction"), - V8FUNCTION(qmlsqldatabase_transaction, engine)); - ft->PrototypeTemplate()->Set(v8::String::New("readTransaction"), - V8FUNCTION(qmlsqldatabase_read_transaction, engine)); - ft->PrototypeTemplate()->SetAccessor(v8::String::New("version"), qmlsqldatabase_version); - ft->PrototypeTemplate()->Set(v8::String::New("changeVersion"), - V8FUNCTION(qmlsqldatabase_changeVersion, engine)); - constructor = qPersistentNew(ft->GetFunction()); - } - - { - v8::Local ft = v8::FunctionTemplate::New(); - ft->InstanceTemplate()->SetHasExternalResource(true); - ft->PrototypeTemplate()->Set(v8::String::New("executeSql"), - V8FUNCTION(qmlsqldatabase_executeSql, engine)); - queryConstructor = qPersistentNew(ft->GetFunction()); - } - { - v8::Local ft = v8::FunctionTemplate::New(); - ft->InstanceTemplate()->SetHasExternalResource(true); - ft->PrototypeTemplate()->Set(v8::String::New("item"), V8FUNCTION(qmlsqldatabase_rows_item, engine)); - ft->PrototypeTemplate()->SetAccessor(v8::String::New("length"), qmlsqldatabase_rows_length); - ft->InstanceTemplate()->SetAccessor(v8::String::New("forwardOnly"), qmlsqldatabase_rows_forwardOnly, - qmlsqldatabase_rows_setForwardOnly); - ft->InstanceTemplate()->SetIndexedPropertyHandler(qmlsqldatabase_rows_index); - rowsConstructor = qPersistentNew(ft->GetFunction()); - } -} - -void *qt_add_qmlsqldatabase(QV8Engine *engine) -{ - v8::Local openDatabase = V8FUNCTION(qmlsqldatabase_open_sync, engine); - engine->global()->Set(v8::String::New("openDatabaseSync"), openDatabase); - - return (void *)new QDeclarativeSqlDatabaseData(engine); -} - -void qt_rem_qmlsqldatabase(QV8Engine * /* engine */, void *d) -{ - QDeclarativeSqlDatabaseData *data = (QDeclarativeSqlDatabaseData *)d; - delete data; -} - -/* -HTML5 "spec" says "rs.rows[n]", but WebKit only impelments "rs.rows.item(n)". We do both (and property iterator). -We add a "forwardOnly" property that stops Qt caching results (code promises to only go forward -through the data. -*/ - -QT_END_NAMESPACE diff --git a/src/declarative/qml/qdeclarativesqldatabase_p.h b/src/declarative/qml/qdeclarativesqldatabase_p.h deleted file mode 100644 index fbfb731..0000000 --- a/src/declarative/qml/qdeclarativesqldatabase_p.h +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QDECLARATIVESQLDATABASE_P_H -#define QDECLARATIVESQLDATABASE_P_H - -#include -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include - -QT_BEGIN_NAMESPACE - -class QV8Engine; - -void *qt_add_qmlsqldatabase(QV8Engine *engine); -void qt_rem_qmlsqldatabase(QV8Engine *engine, void *); - -QT_END_NAMESPACE - -#endif // QDECLARATIVESQLDATABASE_P_H - diff --git a/src/declarative/qml/qml.pri b/src/declarative/qml/qml.pri index d5f57e7..57492a3 100644 --- a/src/declarative/qml/qml.pri +++ b/src/declarative/qml/qml.pri @@ -31,7 +31,6 @@ SOURCES += \ $$PWD/qdeclarativevaluetype.cpp \ $$PWD/qdeclarativeaccessors.cpp \ $$PWD/qdeclarativexmlhttprequest.cpp \ - $$PWD/qdeclarativesqldatabase.cpp \ $$PWD/qdeclarativewatcher.cpp \ $$PWD/qdeclarativecleanup.cpp \ $$PWD/qdeclarativepropertycache.cpp \ @@ -97,7 +96,6 @@ HEADERS += \ $$PWD/qdeclarativevaluetype_p.h \ $$PWD/qdeclarativeaccessors_p.h \ $$PWD/qdeclarativexmlhttprequest_p.h \ - $$PWD/qdeclarativesqldatabase_p.h \ $$PWD/qdeclarativewatcher_p.h \ $$PWD/qdeclarativecleanup_p.h \ $$PWD/qdeclarativepropertycache_p.h \ @@ -125,4 +123,4 @@ include(parser/parser.pri) include(rewriter/rewriter.pri) include(ftw/ftw.pri) include(v4/v4.pri) -include(v8/v8.pri) +include(v8/v8.pri) \ No newline at end of file diff --git a/src/declarative/qml/v8/qv8engine.cpp b/src/declarative/qml/v8/qv8engine.cpp index 2f266a0..405e406 100644 --- a/src/declarative/qml/v8/qv8engine.cpp +++ b/src/declarative/qml/v8/qv8engine.cpp @@ -53,7 +53,6 @@ #include #include #include -#include #include #include "qscript_impl_p.h" @@ -121,7 +120,6 @@ QV8Engine::QV8Engine(QJSEngine* qq, QJSEngine::ContextOwnership ownership) , m_engine(0) , m_ownsV8Context(ownership == QJSEngine::CreateNewContext) , m_xmlHttpRequestData(0) - , m_sqlDatabaseData(0) , m_listModelData(0) { qMetaTypeId(); @@ -167,9 +165,7 @@ QV8Engine::~QV8Engine() delete m_extensionData[ii]; m_extensionData.clear(); - qt_rem_qmlsqldatabase(this, m_sqlDatabaseData); - m_sqlDatabaseData = 0; - qt_rem_qmlxmlhttprequest(this, m_xmlHttpRequestData); + qt_rem_qmlxmlhttprequest(this, m_xmlHttpRequestData); m_xmlHttpRequestData = 0; delete m_listModelData; m_listModelData = 0; @@ -622,7 +618,6 @@ void QV8Engine::initializeGlobal(v8::Handle global) m_xmlHttpRequestData = qt_add_qmlxmlhttprequest(this); qt_add_sqlexceptions(this); - m_sqlDatabaseData = qt_add_qmlsqldatabase(this); { v8::Handle args[] = { global }; diff --git a/src/declarative/qml/v8/qv8engine_p.h b/src/declarative/qml/v8/qv8engine_p.h index a1b8029..7dcbba2 100644 --- a/src/declarative/qml/v8/qv8engine_p.h +++ b/src/declarative/qml/v8/qv8engine_p.h @@ -307,7 +307,6 @@ public: QV8SequenceWrapper *sequenceWrapper() { return &m_sequenceWrapper; } void *xmlHttpRequestData() { return m_xmlHttpRequestData; } - void *sqlDatabaseData() { return m_sqlDatabaseData; } Deletable *listModelData() { return m_listModelData; } void setListModelData(Deletable *d) { if (m_listModelData) delete m_listModelData; m_listModelData = d; } @@ -473,7 +472,6 @@ protected: v8::Persistent m_freezeObject; void *m_xmlHttpRequestData; - void *m_sqlDatabaseData; QVector m_extensionData; Deletable *m_listModelData; -- 2.7.4