diff options
author | Alex Blasche <alexander.blasche@theqtcompany.com> | 2015-01-29 14:13:31 +0100 |
---|---|---|
committer | Alex Blasche <alexander.blasche@theqtcompany.com> | 2015-02-17 07:39:04 +0000 |
commit | 138888ac0d95b33200eb710dce73bc54c4c7f66c (patch) | |
tree | fc44d58e0cdeeacf11418d5b9dbb90454e20bed8 /src/plugins/geoservices/nokia | |
parent | 7ff54e8b0f096e871ae3ac362ab543bb9ba077ee (diff) | |
download | qtlocation-138888ac0d95b33200eb710dce73bc54c4c7f66c.tar.gz |
Use separate cache dir per geoservice/mapping plugin
This has the advantage that concurrent use of multiple plugins
doesn't force one plugin to load the tiles and queues of another plugin
into its tile cache.
QGeoTileCache could potentially separate the non-relevant tiles as well
but that's even more effort and requires the QGeoTileCache instance
to know to which QGeoMappingManagerEngine it belongs.
Task-number: QTBUG-40780
Change-Id: I342168c30a424b9f66d9c4e07694c1e3a9f2a412
Reviewed-by: Michal Klocek <michal.klocek@theqtcompany.com>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/plugins/geoservices/nokia')
-rw-r--r-- | src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp b/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp index e0d6b42b..0b5521f2 100644 --- a/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp +++ b/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp @@ -52,6 +52,7 @@ #include <QtCore/QJsonObject> #include <QtCore/QJsonDocument> #include <QtCore/qmath.h> +#include <QtCore/qstandardpaths.h> QT_BEGIN_NAMESPACE @@ -102,11 +103,16 @@ QGeoTiledMappingManagerEngineNokia::QGeoTiledMappingManagerEngineNokia( setTileFetcher(fetcher); // TODO: do this in a plugin-neutral way so that other tiled map plugins - // don't need this boilerplate + // don't need this boilerplate or hardcode plugin name QString cacheDir; - if (parameters.contains(QStringLiteral("mapping.cache.directory"))) + if (parameters.contains(QStringLiteral("mapping.cache.directory"))) { cacheDir = parameters.value(QStringLiteral("mapping.cache.directory")).toString(); + } else { + // managerName() is not yet set, we have to hardcode the plugin name below + cacheDir = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + + QLatin1String("/QtLocation/nokia"); + } QGeoTileCache *tileCache = createTileCacheWithDir(cacheDir); |