aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports
diff options
context:
space:
mode:
authorCharles Yin <charles.yin@nokia.com>2012-04-19 13:50:39 +1000
committerQt by Nokia <qt-info@nokia.com>2012-04-20 08:05:15 +0200
commit644f469cfffb2eb433128ef273fd6d15dbd15de1 (patch)
treee7103d7c77949af23febf0e3b005b8ac8f167553 /src/imports
parent04794c29cee0d97fb3b32e1c71a072e34ee37e9c (diff)
Disable local storage if the standard data location is empty
Change-Id: I05ea7fa9521c807099b39e610f965a331e538f6e Reviewed-by: Michael Brasser <michael.brasser@nokia.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/localstorage/plugin.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/imports/localstorage/plugin.cpp b/src/imports/localstorage/plugin.cpp
index 4f08e71fd0..ac007f2849 100644
--- a/src/imports/localstorage/plugin.cpp
+++ b/src/imports/localstorage/plugin.cpp
@@ -567,6 +567,9 @@ void QQuickLocalStorage::openDatabaseSync(QQmlV8Function *args)
{
#ifndef QT_NO_SETTINGS
QV8Engine *engine = args->engine();
+ if (engine->engine()->offlineStoragePath().isEmpty())
+ V8THROW_SQL_VOID(SQLEXCEPTION_DATABASE_ERR, QQmlEngine::tr("SQL: can't create database, offline storage is disabled."));
+
qmlsqldatabase_initDatabasesPath(engine);
QSqlDatabase database;