summaryrefslogtreecommitdiff
path: root/platform/glfw
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2018-09-19 09:55:12 +0200
committerKonstantin Käfer <mail@kkaefer.com>2018-09-19 21:10:11 +0200
commit60b8469c488468364c7124750f34e5aebb80dc84 (patch)
treec66466d5f66ae90326b98d15b7d6a65aa9c0e036 /platform/glfw
parent47eaea21ddf1f56e3bb1b8ab35acee8a84f91533 (diff)
downloadqtlocation-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.cpp4
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.");