From 3d0edd64218b3589f562e79d1339a586e7045af5 Mon Sep 17 00:00:00 2001 From: "Thiago Marcos P. Santos" Date: Mon, 4 Mar 2019 15:51:37 +0200 Subject: [qt] Also use the base APU URL as key for sharing the cache. Otherwise we will have a URL pointing to different servers and potentially different data. --- platform/qt/src/qmapboxgl.cpp | 5 +++-- 1 file 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 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 lock(mutex); @@ -109,7 +110,7 @@ std::shared_ptr 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 sharedDefaultFileSource(const QMapboxGL // Setup the FileSource newFileSource->setAccessToken(accessToken); - newFileSource->setAPIBaseURL(settings.apiBaseUrl().toStdString()); + newFileSource->setAPIBaseURL(apiBaseUrl); fileSources[key] = newFileSource; -- cgit v1.2.1