diff options
author | Robert C. Helling <helling@atdotde.de> | 2017-01-07 03:11:19 +0100 |
---|---|---|
committer | Subsurface <dirk@subsurface-divelog.org> | 2017-01-06 20:43:23 -0800 |
commit | 935734100f07092800ec4467b88c59a9a4efd572 (patch) | |
tree | 20a3398c4f7bece093928f754a84e975f74f6ffb | |
parent | bb4bf639c333bee28d398c3670f52797d726b126 (diff) | |
download | subsurface-935734100f07092800ec4467b88c59a9a4efd572.tar.gz |
Rename prefs.deco_mode to prefs.planner_deco_mode
This is to avoid confusion with planner.display_deco_mode.
When accessing the "current deco mode" use the decoMode()
helper function.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
-rw-r--r-- | core/pref.h | 2 | ||||
-rw-r--r-- | core/qthelper.cpp | 2 | ||||
-rw-r--r-- | core/subsurface-qt/SettingsObjectWrapper.cpp | 16 | ||||
-rw-r--r-- | core/subsurfacestartup.c | 2 | ||||
-rw-r--r-- | desktop-widgets/diveplanner.cpp | 8 | ||||
-rw-r--r-- | qt-models/diveplannermodel.cpp | 4 | ||||
-rw-r--r-- | tests/testplan.cpp | 6 |
7 files changed, 20 insertions, 20 deletions
diff --git a/core/pref.h b/core/pref.h index 78d49b11a..293899ab6 100644 --- a/core/pref.h +++ b/core/pref.h @@ -143,7 +143,7 @@ struct preferences { short cloud_verification_status; bool cloud_background_sync; geocoding_prefs_t geocoding; - enum deco_mode deco_mode; + enum deco_mode planner_deco_mode; short vpmb_conservatism; int time_threshold; int distance_threshold; diff --git a/core/qthelper.cpp b/core/qthelper.cpp index fc9675279..1034316bb 100644 --- a/core/qthelper.cpp +++ b/core/qthelper.cpp @@ -1439,7 +1439,7 @@ extern "C" bool in_planner() extern "C" enum deco_mode decoMode() { - return in_planner() ? prefs.deco_mode : prefs.display_deco_mode; + return in_planner() ? prefs.planner_deco_mode : prefs.display_deco_mode; } void init_proxy() diff --git a/core/subsurface-qt/SettingsObjectWrapper.cpp b/core/subsurface-qt/SettingsObjectWrapper.cpp index 34fe3dd45..dfb486065 100644 --- a/core/subsurface-qt/SettingsObjectWrapper.cpp +++ b/core/subsurface-qt/SettingsObjectWrapper.cpp @@ -319,7 +319,7 @@ bool TechnicalDetailsSettings::calcndltts() const bool TechnicalDetailsSettings::buehlmann() const { - return (prefs.deco_mode == BUEHLMANN); + return (prefs.planner_deco_mode == BUEHLMANN); } int TechnicalDetailsSettings::gflow() const @@ -524,12 +524,12 @@ void TechnicalDetailsSettings::setCalcndltts(bool value) void TechnicalDetailsSettings::setBuehlmann(bool value) { - if (value == (prefs.deco_mode == BUEHLMANN)) + if (value == (prefs.planner_deco_mode == BUEHLMANN)) return; QSettings s; s.beginGroup(group); s.setValue("buehlmann", value); - prefs.deco_mode = value ? BUEHLMANN : VPMB; + prefs.planner_deco_mode = value ? BUEHLMANN : VPMB; emit buehlmannChanged(value); } @@ -1277,7 +1277,7 @@ int DivePlannerSettings::decoSac() const deco_mode DivePlannerSettings::decoMode() const { - return prefs.deco_mode; + return prefs.planner_deco_mode; } void DivePlannerSettings::setLastStop(bool value) @@ -1527,13 +1527,13 @@ void DivePlannerSettings::setDecoSac(int value) void DivePlannerSettings::setDecoMode(deco_mode value) { - if (value == prefs.deco_mode) + if (value == prefs.planner_deco_mode) return; QSettings s; s.beginGroup(group); s.setValue("deco_mode", value); - prefs.deco_mode = value; + prefs.planner_deco_mode = value; emit decoModeChanged(value); } @@ -2286,7 +2286,7 @@ void SettingsObjectWrapper::load() GET_INT("bottomsac", bottomsac); GET_INT("decosac", decosac); - prefs.deco_mode = deco_mode(s.value("deco_mode", default_prefs.deco_mode).toInt()); + prefs.planner_deco_mode = deco_mode(s.value("deco_mode", default_prefs.planner_deco_mode).toInt()); s.endGroup(); s.beginGroup("DiveComputer"); @@ -2340,7 +2340,7 @@ void SettingsObjectWrapper::sync() s.setValue("min_switch_duration", prefs.min_switch_duration); s.setValue("bottomsac", prefs.bottomsac); s.setValue("decosac", prefs.decosac); - s.setValue("deco_mode", int(prefs.deco_mode)); + s.setValue("deco_mode", int(prefs.planner_deco_mode)); s.endGroup(); } diff --git a/core/subsurfacestartup.c b/core/subsurfacestartup.c index 200e23bef..c740153bf 100644 --- a/core/subsurfacestartup.c +++ b/core/subsurfacestartup.c @@ -86,7 +86,7 @@ struct preferences default_prefs = { .locale = { .use_system_language = true, }, - .deco_mode = BUEHLMANN, + .planner_deco_mode = BUEHLMANN, .vpmb_conservatism = 3, .distance_threshold = 1000, .time_threshold = 600, diff --git a/desktop-widgets/diveplanner.cpp b/desktop-widgets/diveplanner.cpp index ee85d12bc..0eee95ebf 100644 --- a/desktop-widgets/diveplanner.cpp +++ b/desktop-widgets/diveplanner.cpp @@ -303,10 +303,10 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f) ui.drop_stone_mode->setChecked(prefs.drop_stone_mode); ui.switch_at_req_stop->setChecked(prefs.switch_at_req_stop); ui.min_switch_duration->setValue(prefs.min_switch_duration / 60); - ui.recreational_deco->setChecked(prefs.deco_mode == RECREATIONAL); - ui.buehlmann_deco->setChecked(prefs.deco_mode == BUEHLMANN); - ui.vpmb_deco->setChecked(prefs.deco_mode == VPMB); - disableDecoElements((int) prefs.deco_mode); + ui.recreational_deco->setChecked(prefs.planner_deco_mode == RECREATIONAL); + ui.buehlmann_deco->setChecked(prefs.planner_deco_mode == BUEHLMANN); + ui.vpmb_deco->setChecked(prefs.planner_deco_mode == VPMB); + disableDecoElements((int) prefs.planner_deco_mode); // should be the same order as in dive_comp_type! rebreather_modes << tr("Open circuit") << tr("CCR") << tr("pSCR"); diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp index 43e4686ff..792ea822f 100644 --- a/qt-models/diveplannermodel.cpp +++ b/qt-models/diveplannermodel.cpp @@ -485,8 +485,8 @@ void DivePlannerPointsModel::setDisplayTransitions(bool value) void DivePlannerPointsModel::setDecoMode(int mode) { - prefs.deco_mode = deco_mode(mode); - emit recreationChanged(mode == int(prefs.deco_mode)); + prefs.planner_deco_mode = deco_mode(mode); + emit recreationChanged(mode == int(prefs.planner_deco_mode)); emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS -1)); } diff --git a/tests/testplan.cpp b/tests/testplan.cpp index 43473db7a..a3fb5240a 100644 --- a/tests/testplan.cpp +++ b/tests/testplan.cpp @@ -32,7 +32,7 @@ void setupPrefsVpmb() prefs.ascratelast6m = prefs.ascrate50; prefs.descrate = 99000 / 60; prefs.last_stop = false; - prefs.deco_mode = VPMB; + prefs.planner_deco_mode = VPMB; prefs.vpmb_conservatism = 0; } @@ -284,7 +284,7 @@ void TestPlan::testMetric() setupPrefs(); prefs.unit_system = METRIC; prefs.units.length = units::METERS; - prefs.deco_mode = BUEHLMANN; + prefs.planner_deco_mode = BUEHLMANN; struct diveplan testPlan = {}; setupPlan(&testPlan); @@ -320,7 +320,7 @@ void TestPlan::testImperial() setupPrefs(); prefs.unit_system = IMPERIAL; prefs.units.length = units::FEET; - prefs.deco_mode = BUEHLMANN; + prefs.planner_deco_mode = BUEHLMANN; struct diveplan testPlan = {}; setupPlan(&testPlan); |