diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-11-16 05:28:35 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-11-16 05:28:35 (GMT) |
commit | a62fbc821c3c32c0ebe63a77f2705d6f1db67394 (patch) | |
tree | f0b883a68f97668c66b68c0e29407b2011c13671 /src/declarative/qml/qmlengine.cpp | |
parent | fda2044359c3361b6b525d21fc455160d0ea746a (diff) | |
download | Qt-a62fbc821c3c32c0ebe63a77f2705d6f1db67394.zip Qt-a62fbc821c3c32c0ebe63a77f2705d6f1db67394.tar.gz Qt-a62fbc821c3c32c0ebe63a77f2705d6f1db67394.tar.bz2 |
Use QDir::separator() and follow no-trailing-slash convention.
Fixes QTBUG-5841
Diffstat (limited to 'src/declarative/qml/qmlengine.cpp')
-rw-r--r-- | src/declarative/qml/qmlengine.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index 66d4990..c8848fd 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -112,11 +112,6 @@ struct StaticQtMetaObject : public QObject { return &static_cast<StaticQtMetaObject*> (0)->staticQtMetaObject; } }; -static QString userLocalDataPath(const QString& app) -{ - return QDesktopServices::storageLocation(QDesktopServices::DataLocation) + QLatin1String("/") + app; -} - QmlEnginePrivate::QmlEnginePrivate(QmlEngine *e) : rootContext(0), currentExpression(0), isDebugging(false), contextClass(0), objectClass(0), valueTypeClass(0), globalClass(0), @@ -130,7 +125,9 @@ QmlEnginePrivate::QmlEnginePrivate(QmlEngine *e) scriptEngine.newQMetaObject(StaticQtMetaObject::get()); scriptEngine.globalObject().setProperty(QLatin1String("Qt"), qtObject); - offlineStoragePath = userLocalDataPath(QLatin1String("QML/OfflineStorage")); + offlineStoragePath = QDesktopServices::storageLocation(QDesktopServices::DataLocation) + + QDir::separator() + QLatin1String("QML") + + QDir::separator() + QLatin1String("OfflineStorage"); qt_add_qmlxmlhttprequest(&scriptEngine); qt_add_qmlsqldatabase(&scriptEngine); @@ -1265,8 +1262,12 @@ void QmlEngine::addImportPath(const QString& path) QmlGraphicsWebView and the SQL databases created with openDatabase() are stored here. - The default is QML/OfflineStorage/ in the platform-standard + The default is QML/OfflineStorage in the platform-standard user application data directory. + + Note that the path may not currently exist on the filesystem, so + callers wanting to \e create new files at this location should create + it first - see QDir::mkpath(). */ void QmlEngine::setOfflineStoragePath(const QString& dir) { |