summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2019-03-04 15:51:37 +0200
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2019-03-04 19:33:45 +0200
commit7b7ad9d39b4e5427dc1ce10dbddf4fbe2fc7e268 (patch)
tree28e6ebef3244ceb66771b387f978769fc7696371
parent4bc56cc5764779ec23325530dfb6acfef125ccf8 (diff)
downloadqtlocation-mapboxgl-7b7ad9d39b4e5427dc1ce10dbddf4fbe2fc7e268.tar.gz
[qt] Also use the base API URL as key for sharing the cache.
Otherwise we will have a URL pointing to different servers and potentially different data.
-rw-r--r--platform/qt/src/qmapboxgl.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/platform/qt/src/qmapboxgl.cpp b/platform/qt/src/qmapboxgl.cpp
index 7ed8f04007..fd4a210229 100644
--- a/platform/qt/src/qmapboxgl.cpp
+++ b/platform/qt/src/qmapboxgl.cpp
@@ -97,6 +97,7 @@ std::shared_ptr<mbgl::DefaultFileSource> sharedDefaultFileSource(const QMapboxGL
const std::string cachePath = settings.cacheDatabasePath().toStdString();
const std::string accessToken = settings.accessToken().toStdString();
+ const std::string apiBaseUrl = settings.apiBaseUrl().toStdString();
std::lock_guard<std::mutex> lock(mutex);
@@ -109,7 +110,7 @@ std::shared_ptr<mbgl::DefaultFileSource> sharedDefaultFileSource(const QMapboxGL
}
}
- const auto key = cachePath + "|" + accessToken;
+ const auto key = cachePath + "|" + accessToken + "|" + apiBaseUrl;
// Return an existing FileSource if available.
auto sharedFileSource = fileSources.find(key);
@@ -123,7 +124,7 @@ std::shared_ptr<mbgl::DefaultFileSource> sharedDefaultFileSource(const QMapboxGL
// Setup the FileSource
newFileSource->setAccessToken(accessToken);
- newFileSource->setAPIBaseURL(settings.apiBaseUrl().toStdString());
+ newFileSource->setAPIBaseURL(apiBaseUrl);
fileSources[key] = newFileSource;