summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2017-01-07 03:11:19 +0100
committerGravatar Subsurface <dirk@subsurface-divelog.org>2017-01-06 20:43:23 -0800
commit935734100f07092800ec4467b88c59a9a4efd572 (patch)
tree20a3398c4f7bece093928f754a84e975f74f6ffb /core
parentbb4bf639c333bee28d398c3670f52797d726b126 (diff)
downloadsubsurface-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>
Diffstat (limited to 'core')
-rw-r--r--core/pref.h2
-rw-r--r--core/qthelper.cpp2
-rw-r--r--core/subsurface-qt/SettingsObjectWrapper.cpp16
-rw-r--r--core/subsurfacestartup.c2
4 files changed, 11 insertions, 11 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,