summaryrefslogtreecommitdiff
path: root/platform/glfw
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2019-03-21 18:36:43 +0200
committerBruno de Oliveira Abinader <bruno@mapbox.com>2019-03-22 18:54:48 +0200
commit03db58cdc1f1f31034863020f205f5c5696bfa8b (patch)
treee4201a14948d3772fbd4f8bcff6f7d38e2dfd27d /platform/glfw
parent2de2b0b068520a55170d23c86f349232b3e28ae7 (diff)
downloadqtlocation-mapboxgl-03db58cdc1f1f31034863020f205f5c5696bfa8b.tar.gz
[core] Replace shared_ptr with unique_ptr in {Map,Resource}Options
Diffstat (limited to 'platform/glfw')
-rw-r--r--platform/glfw/main.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/platform/glfw/main.cpp b/platform/glfw/main.cpp
index 8288a009f2..77585718e1 100644
--- a/platform/glfw/main.cpp
+++ b/platform/glfw/main.cpp
@@ -94,12 +94,14 @@ int main(int argc, char *argv[]) {
view = &backend;
// Set access token if present
- const char *token = getenv("MAPBOX_ACCESS_TOKEN");
- if (token == nullptr) {
+ std::string token(getenv("MAPBOX_ACCESS_TOKEN") ?: "");
+ if (token.empty()) {
mbgl::Log::Warning(mbgl::Event::Setup, "no access token set. mapbox.com tiles won't work.");
}
- auto resourceOptions = mbgl::ResourceOptions().withCachePath(cacheDB).withAssetPath(".").withAccessToken(std::string(token));
+ mbgl::ResourceOptions resourceOptions;
+ resourceOptions.withCachePath(cacheDB).withAccessToken(token);
+
auto fileSource = std::static_pointer_cast<mbgl::DefaultFileSource>(mbgl::FileSource::getSharedFileSource(resourceOptions));
if (!settings.online) {
fileSource->setOnlineStatus(false);