From c1a76c75df5ae4f0624d8456b336ecee2514c357 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 13 Mar 2015 23:41:52 +0100 Subject: initialize "s_main" bundle implicitly --- facetracknoir/ui.cpp | 6 +++--- opentrack/main-settings.hpp | 4 ++-- opentrack/shortcuts.h | 3 +-- opentrack/state.hpp | 3 --- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/facetracknoir/ui.cpp b/facetracknoir/ui.cpp index 11ae5d3e..54e4646e 100644 --- a/facetracknoir/ui.cpp +++ b/facetracknoir/ui.cpp @@ -126,7 +126,7 @@ void MainWindow::save_mappings() { #endif void MainWindow::save() { - b->save(); + s.b->save(); save_mappings(); mem settings = group::ini_file(); settings->sync(); @@ -170,7 +170,7 @@ void MainWindow::load_mappings() { } void MainWindow::load_settings() { - b->reload(); + s.b->reload(); load_mappings(); } @@ -212,7 +212,7 @@ void MainWindow::bindKeyboardShortcuts() } void MainWindow::startTracker( ) { - b->save(); + s.b->save(); load_settings(); bindKeyboardShortcuts(); diff --git a/opentrack/main-settings.hpp b/opentrack/main-settings.hpp index 971e0fba..0468aeb1 100644 --- a/opentrack/main-settings.hpp +++ b/opentrack/main-settings.hpp @@ -30,8 +30,8 @@ struct main_settings { value tray_enabled; value camera_yaw, camera_pitch; value center_at_startup; - main_settings(pbundle b) : - b(b), + main_settings() : + b(bundle("opentrack-ui")), tracker_dll(b, "tracker-dll", ""), tracker2_dll(b, "tracker2-dll", ""), filter_dll(b, "filter-dll", ""), diff --git a/opentrack/shortcuts.h b/opentrack/shortcuts.h index 6989ea29..4d4b19d3 100644 --- a/opentrack/shortcuts.h +++ b/opentrack/shortcuts.h @@ -112,8 +112,7 @@ public: b(bundle("keyboard-shortcuts")), center(b, "center"), toggle(b, "toggle"), - zero(b, "zero"), - s_main(bundle("opentrack-ui")) + zero(b, "zero") {} } s; diff --git a/opentrack/state.hpp b/opentrack/state.hpp index c8d97d16..2c37e5eb 100644 --- a/opentrack/state.hpp +++ b/opentrack/state.hpp @@ -35,13 +35,10 @@ struct Work; struct State { State() : - b(bundle("opentrack-ui")), - s(b), pose(std::vector{&s.a_x, &s.a_y, &s.a_z, &s.a_yaw, &s.a_pitch, &s.a_roll}) {} Modules modules; SelectedLibraries libs; - pbundle b; main_settings s; Mappings pose; mem work; -- cgit v1.2.3