diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2014-04-30 13:47:03 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2014-04-30 13:47:03 +0200 |
commit | 9bbdba9eab28c2ba44002bada4b3bb1c0962bd90 (patch) | |
tree | 4a56a077b8597395dd0f38c5ab9cb0c87862afa1 /macosx/main.mm | |
parent | e95ece83335b85ed063f8ea903acc71d5a2fb995 (diff) | |
download | qtlocation-mapboxgl-9bbdba9eab28c2ba44002bada4b3bb1c0962bd90.tar.gz |
remove concept of settings object from library
Diffstat (limited to 'macosx/main.mm')
-rw-r--r-- | macosx/main.mm | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/macosx/main.mm b/macosx/main.mm index 8d2b0d8ce9..4347a7ce86 100644 --- a/macosx/main.mm +++ b/macosx/main.mm @@ -1,14 +1,25 @@ -// #import <Foundation/Foundation.h> -// #import <AppKit/AppKit.h> - -#include "settings.hpp" +#include "../common/settings_nsuserdefaults.hpp" #include "../common/glfw_view.hpp" int main() { - llmr::Settings_MacOSX settings; - MapView view(settings); - view.init(); + GLFWView view; + llmr::Map map(view); + + // Load settings + llmr::Settings_NSUserDefaults settings; + map.setLonLatZoom(settings.longitude, settings.latitude, settings.zoom); + map.setAngle(settings.angle); + map.setDebug(settings.debug); + + // fprintf(stderr, "lon: %f, lat: %f, zoom: %f, angle: %f, debug: %d\n", settings.l) + int ret = view.run(); - settings.sync(); + + // Save settings + map.getLonLatZoom(settings.longitude, settings.latitude, settings.zoom); + settings.angle = map.getAngle(); + settings.debug = map.getDebug(); + settings.save(); + return ret; } |