aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2017-02-06 15:47:33 +0100
committerSimon Hausmann <simon.hausmann@qt.io>2017-02-08 11:20:42 +0000
commitaa76e89b4d66e80c66999680e6a3db00c8a00b33 (patch)
tree14a8d67c41ca6e2ec380791cfda193a4d61ff223 /src/imports
parentd7161f3af6104faaedb68e1a8a4277dabeb1f8af (diff)
Local storage: Improve error message
Use %-placeholder formatting instead of concatenating strings which may not work in some languages and pass path through QDir::toNativeSeparators(). Amends change f96b77bf46a29b1c09d6ebff2f18a475c7ca0b2f. Change-Id: Iee6782a41513529bb6e4c0cde62b477a68bbcd02 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/localstorage/plugin.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/imports/localstorage/plugin.cpp b/src/imports/localstorage/plugin.cpp
index 433b7fe430..60b8dad5fb 100644
--- a/src/imports/localstorage/plugin.cpp
+++ b/src/imports/localstorage/plugin.cpp
@@ -714,8 +714,11 @@ void QQuickLocalStorage::openDatabaseSync(QQmlV4Function *args)
FunctionObject *dbcreationCallback = (v = (*args)[4])->as<FunctionObject>();
QString basename = args->v4engine()->qmlEngine()->offlineStorageDatabaseFilePath(dbname);
QFileInfo dbFile(basename);
- if (!QDir().mkpath(dbFile.dir().absolutePath()))
- V4THROW_SQL2(SQLEXCEPTION_DATABASE_ERR, QQmlEngine::tr("LocalStorage: can't create path ") + dbFile.dir().absolutePath());
+ if (!QDir().mkpath(dbFile.dir().absolutePath())) {
+ const QString message = QQmlEngine::tr("LocalStorage: can't create path %1").
+ arg(QDir::toNativeSeparators(dbFile.dir().absolutePath()));
+ V4THROW_SQL2(SQLEXCEPTION_DATABASE_ERR, message);
+ }
QString dbid = dbFile.fileName();
bool created = false;
QString version = dbversion;