From 5e27d57916da22af9d072156a59c23cf530cdca2 Mon Sep 17 00:00:00 2001 From: Albin Olsson Date: Thu, 19 Sep 2013 09:29:54 +0200 Subject: Move tilecache storage to a standard location ~/.tilecache is not standard. Base path off of QStandardPaths::CacheLocation Change-Id: I66573afe33f756f86afef02951a8b4800a4aea5d Reviewed-by: Alex Blasche --- src/location/doc/src/plugins/nokia.qdoc | 2 +- src/location/maps/qgeotilecache.cpp | 9 ++++----- 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 +#include #include #include #include @@ -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 -- cgit v1.2.3