diff options
Diffstat (limited to 'src/qmllocalstorage')
-rw-r--r-- | src/qmllocalstorage/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/qmllocalstorage/qqmllocalstorage.cpp | 6 | ||||
-rw-r--r-- | src/qmllocalstorage/qqmllocalstorage_p.h | 4 | ||||
-rw-r--r-- | src/qmllocalstorage/qqmllocalstorageglobal_p.h | 2 |
4 files changed, 7 insertions, 9 deletions
diff --git a/src/qmllocalstorage/CMakeLists.txt b/src/qmllocalstorage/CMakeLists.txt index 63ecdcec29..0517b2231a 100644 --- a/src/qmllocalstorage/CMakeLists.txt +++ b/src/qmllocalstorage/CMakeLists.txt @@ -15,6 +15,4 @@ qt_internal_add_qml_module(QmlLocalStorage Qt::CorePrivate Qt::QmlPrivate Qt::Sql - GENERATE_CPP_EXPORTS - GENERATE_PRIVATE_CPP_EXPORTS -) + ) diff --git a/src/qmllocalstorage/qqmllocalstorage.cpp b/src/qmllocalstorage/qqmllocalstorage.cpp index e3b0159c09..bed86c141e 100644 --- a/src/qmllocalstorage/qqmllocalstorage.cpp +++ b/src/qmllocalstorage/qqmllocalstorage.cpp @@ -682,7 +682,7 @@ Returns the created database object. */ -void QQmlLocalStorage::openDatabaseSync(QQmlV4Function *args) +void QQmlLocalStorage::openDatabaseSync(QQmlV4FunctionPtr args) { #if QT_CONFIG(settings) QV4::Scope scope(args->v4engine()); @@ -735,8 +735,8 @@ void QQmlLocalStorage::openDatabaseSync(QQmlV4Function *args) database = QSqlDatabase::addDatabase(QLatin1String("QSQLITE"), dbid); database.setDatabaseName(basename+QLatin1String(".sqlite")); } - if (!database.isOpen()) - database.open(); + if (!database.isOpen() && !database.open()) + V4THROW_SQL2(SQLEXCEPTION_DATABASE_ERR, QQmlEngine::tr("SQL: Cannot open database")); } QV4::Scoped<QQmlSqlDatabaseWrapper> db(scope, QQmlSqlDatabaseWrapper::create(scope.engine)); diff --git a/src/qmllocalstorage/qqmllocalstorage_p.h b/src/qmllocalstorage/qqmllocalstorage_p.h index 94d46d5fa6..510ee78dbe 100644 --- a/src/qmllocalstorage/qqmllocalstorage_p.h +++ b/src/qmllocalstorage/qqmllocalstorage_p.h @@ -23,7 +23,7 @@ QT_BEGIN_NAMESPACE -class Q_QMLLOCALSTORAGE_PRIVATE_EXPORT QQmlLocalStorage : public QObject +class Q_QMLLOCALSTORAGE_EXPORT QQmlLocalStorage : public QObject { Q_OBJECT QML_NAMED_ELEMENT(LocalStorage) @@ -34,7 +34,7 @@ public: QQmlLocalStorage(QObject *parent = nullptr) : QObject(parent) {} ~QQmlLocalStorage() override = default; - Q_INVOKABLE void openDatabaseSync(QQmlV4Function* args); + Q_INVOKABLE void openDatabaseSync(QQmlV4FunctionPtr args); }; QT_END_NAMESPACE diff --git a/src/qmllocalstorage/qqmllocalstorageglobal_p.h b/src/qmllocalstorage/qqmllocalstorageglobal_p.h index 0362f9955c..9f36a1f367 100644 --- a/src/qmllocalstorage/qqmllocalstorageglobal_p.h +++ b/src/qmllocalstorage/qqmllocalstorageglobal_p.h @@ -16,6 +16,6 @@ // #include <QtCore/qglobal.h> -#include <QtQmlLocalStorage/private/qtqmllocalstorageexports_p.h> +#include <QtQmlLocalStorage/qtqmllocalstorageexports.h> #endif // QQMLLOCALSTORAGEGLOBAL_P_H |