diff options
author | Robert C. Helling <helling@atdotde.de> | 2017-01-07 03:01:14 +0100 |
---|---|---|
committer | Subsurface <dirk@subsurface-divelog.org> | 2017-01-06 20:43:23 -0800 |
commit | bb4bf639c333bee28d398c3670f52797d726b126 (patch) | |
tree | c28fe4eb2f51dc226931ee16e58edade6bf644ea /profile-widget/profilewidget2.cpp | |
parent | 4e375f56a8b15212b96e0ce5b7ca4724dc268612 (diff) | |
download | subsurface-bb4bf639c333bee28d398c3670f52797d726b126.tar.gz |
Fix deco_mode confusion
We have two prefernces determining the deco_mode (BUEHLMANN vs VPMB
vs RECREATIONAL): One for the planner (deco_mode) and one for
displaying dives (display_deco_mode). The former is set in the planner
settings while the latter is set in the preferences.
This patch clears up a confusion which of the two to use by introducing
a helper function that selects the correct variable.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Diffstat (limited to 'profile-widget/profilewidget2.cpp')
-rw-r--r-- | profile-widget/profilewidget2.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp index 44e06eafb..f0df220e3 100644 --- a/profile-widget/profilewidget2.cpp +++ b/profile-widget/profilewidget2.cpp @@ -19,6 +19,7 @@ #include "desktop-widgets/diveplanner.h" #include "desktop-widgets/simplewidgets.h" #include "desktop-widgets/divepicturewidget.h" +#include "core/qthelper.h" #endif #include <libdivecomputer/parser.h> @@ -558,7 +559,7 @@ void ProfileWidget2::plotDive(struct dive *d, bool force) // this copies the dive and makes copies of all the relevant additional data copy_dive(d, &displayed_dive); #ifndef SUBSURFACE_MOBILE - if ((currentState == PLAN && prefs.deco_mode == VPMB) || prefs.display_deco_mode == VPMB) + if (decoMode() == VPMB) decoModelParameters->setText(QString("VPM-B +%1").arg(prefs.vpmb_conservatism)); else decoModelParameters->setText(QString("GF %1/%2").arg(prefs.gflow).arg(prefs.gfhigh)); @@ -570,7 +571,7 @@ void ProfileWidget2::plotDive(struct dive *d, bool force) plannerModel->deleteTemporaryPlan(); return; } - if ((currentState == PLAN && prefs.deco_mode == VPMB) || prefs.display_deco_mode == VPMB) + if (decoMode() == VPMB) decoModelParameters->setText(QString("VPM-B +%1").arg(diveplan.vpmb_conservatism)); else decoModelParameters->setText(QString("GF %1/%2").arg(diveplan.gflow).arg(diveplan.gfhigh)); |