summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-11-18 02:57:58 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-11-18 02:57:58 (GMT)
commit6329879b47afad504eab2e629d15404bf7224cfb (patch)
tree1196b0d215671d160c60593d9dae00f81ecfc533 /src/declarative
parent7eb051d82a5bd35f86b5f692e2da5ea133e6b7b0 (diff)
downloadQt-6329879b47afad504eab2e629d15404bf7224cfb.zip
Qt-6329879b47afad504eab2e629d15404bf7224cfb.tar.gz
Qt-6329879b47afad504eab2e629d15404bf7224cfb.tar.bz2
Don't make assumptions about when SQLITE creates database files.
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/qml/qmlsqldatabase.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/declarative/qml/qmlsqldatabase.cpp b/src/declarative/qml/qmlsqldatabase.cpp
index 123b85f..9e4c198 100644
--- a/src/declarative/qml/qmlsqldatabase.cpp
+++ b/src/declarative/qml/qmlsqldatabase.cpp
@@ -440,10 +440,10 @@ static QScriptValue qmlsqldatabase_open_sync(QScriptContext *context, QScriptEng
if (QSqlDatabase::connectionNames().contains(dbid)) {
database = QSqlDatabase::database(dbid);
} else {
+ created = !QFile::exists(basename+QLatin1String(".sqlite"));
database = QSqlDatabase::addDatabase(QLatin1String("QSQLITE"), dbid);
QDir().mkpath(basename);
- if (!QFile::exists(basename+QLatin1String(".sqlite"))) {
- created = true;
+ if (created) {
ini.setValue(QLatin1String("Name"), dbname);
if (dbcreationCallback.isFunction())
version = QString();