diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2018-09-19 09:55:12 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2018-09-19 21:10:11 +0200 |
commit | 60b8469c488468364c7124750f34e5aebb80dc84 (patch) | |
tree | c66466d5f66ae90326b98d15b7d6a65aa9c0e036 /platform/glfw | |
parent | 47eaea21ddf1f56e3bb1b8ab35acee8a84f91533 (diff) | |
download | qtlocation-mapboxgl-60b8469c488468364c7124750f34e5aebb80dc84.tar.gz |
[core] add --cache option to GLFW binary to specify the cache database
Diffstat (limited to 'platform/glfw')
-rw-r--r-- | platform/glfw/main.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/platform/glfw/main.cpp b/platform/glfw/main.cpp index 8915f1d7f1..1bb2e13614 100644 --- a/platform/glfw/main.cpp +++ b/platform/glfw/main.cpp @@ -43,6 +43,7 @@ int main(int argc, char *argv[]) { args::Flag offlineFlag(argumentParser, "offline", "Toggle offline", {'o', "offline"}); args::ValueFlag<std::string> styleValue(argumentParser, "URL", "Map stylesheet", {'s', "style"}); + args::ValueFlag<std::string> cacheDBValue(argumentParser, "file", "Cache database file name", {'c', "cache"}); args::ValueFlag<double> lonValue(argumentParser, "degrees", "Longitude", {'x', "lon"}); args::ValueFlag<double> latValue(argumentParser, "degrees", "Latitude", {'y', "lat"}); args::ValueFlag<double> zoomValue(argumentParser, "number", "Zoom level", {'z', "zoom"}); @@ -76,6 +77,7 @@ int main(int argc, char *argv[]) { const bool fullscreen = fullscreenFlag ? args::get(fullscreenFlag) : false; const bool benchmark = benchmarkFlag ? args::get(benchmarkFlag) : false; std::string style = styleValue ? args::get(styleValue) : ""; + const std::string cacheDB = cacheDBValue ? args::get(cacheDBValue) : "/tmp/mbgl-cache.db"; // sigint handling struct sigaction sigIntHandler; @@ -91,7 +93,7 @@ int main(int argc, char *argv[]) { GLFWView backend(fullscreen, benchmark); view = &backend; - mbgl::DefaultFileSource fileSource("/tmp/mbgl-cache.db", "."); + mbgl::DefaultFileSource fileSource(cacheDB, "."); if (!settings.online) { fileSource.setOnlineStatus(false); mbgl::Log::Warning(mbgl::Event::Setup, "Application is offline. Press `O` to toggle online status."); |