summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlbin Olsson <albin.olsson@cybercom.com>2013-09-19 09:29:54 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-20 08:39:28 +0200
commit5e27d57916da22af9d072156a59c23cf530cdca2 (patch)
treec4847b3880768b444b1d63bede17b91b053c80b8
parentdeccc5f146c38d5bafe4b608c30a28602ef20f6d (diff)
Move tilecache storage to a standard location
~/.tilecache is not standard. Base path off of QStandardPaths::CacheLocation Change-Id: I66573afe33f756f86afef02951a8b4800a4aea5d Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
-rw-r--r--src/location/doc/src/plugins/nokia.qdoc2
-rw-r--r--src/location/maps/qgeotilecache.cpp9
2 files changed, 5 insertions, 6 deletions
diff --git a/src/location/doc/src/plugins/nokia.qdoc b/src/location/doc/src/plugins/nokia.qdoc
index f3a8f58d..181acbb8 100644
--- a/src/location/doc/src/plugins/nokia.qdoc
+++ b/src/location/doc/src/plugins/nokia.qdoc
@@ -85,7 +85,7 @@ The following table lists optional parameters that can be passed to the Nokia pl
\li mapping.cache.directory
\li Map tile cache directory used as network disk cache.
- Default place for the cache is ".tilecache" directory in \l {QDir::home()}.
+ Default place for the cache is "QtLocation" directory in \l {QStandardPaths::writableLocation(QStandardPaths::CacheLocation)}.
\row
\li mapping.cache.disk.size
\li Map tile disk cache size in bytes. Default size of the cache is 20MB.
diff --git a/src/location/maps/qgeotilecache.cpp b/src/location/maps/qgeotilecache.cpp
index 2c31dcee..70709ce5 100644
--- a/src/location/maps/qgeotilecache.cpp
+++ b/src/location/maps/qgeotilecache.cpp
@@ -45,6 +45,7 @@
#include "qgeomappingmanager_p.h"
#include <QDir>
+#include <QStandardPaths>
#include <QMetaType>
#include <QPixmap>
#include <QDebug>
@@ -115,11 +116,9 @@ QGeoTileCache::QGeoTileCache(const QString &directory, QObject *parent)
// of course override them)
if (directory_.isEmpty()) {
- QString dirname = QLatin1String(".tilecache");
- QDir home = QDir::home();
- if (!home.exists(dirname))
- home.mkdir(dirname);
- directory_ = home.filePath(dirname);
+ directory_ = QStandardPaths::writableLocation(QStandardPaths::CacheLocation)
+ + QLatin1String("/QtLocation");
+ QDir::root().mkpath(directory_);
}
// default values