summaryrefslogtreecommitdiffstats
path: root/profile-widget
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2021-02-25 22:20:26 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-04-02 13:53:23 -0700
commit4b801f1f50e0ca78d92673e92f9f05f22514f2d7 (patch)
treece85c1adb808ae64dff7ce1ff2eabe4365b73de6 /profile-widget
parent7b9c8e344a490333196c34fe87235146872b662e (diff)
downloadsubsurface-4b801f1f50e0ca78d92673e92f9f05f22514f2d7.tar.gz
planner: split createTemporaryPlan() function.
The DivePlannerPointsModel::createTemporaryPlan() function had two distinct and independent parts: 1) create the data points. 2) create the dive sample and calculate variations. The second part was only exectuted if the recalc flag was set. Out of the two callers, one was explicitly disabling and setting the recalc flag to avoid the second part. The much more logical thing is to simply split the function in two and only call the first part. To avoid any functional change, the second caller (the profile) still tests for the recalc flag. However, if it shouldn't replot a new plan, why calculate it in the first place!? And why does the display function change the plan at all? This appears all very ill-thought out and should be changed in due course. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'profile-widget')
-rw-r--r--profile-widget/profilewidget2.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp
index d5cae62a4..d0c58c8ab 100644
--- a/profile-widget/profilewidget2.cpp
+++ b/profile-widget/profilewidget2.cpp
@@ -543,6 +543,7 @@ void ProfileWidget2::plotDive(const struct dive *dIn, int dcIn, bool force, bool
#ifndef SUBSURFACE_MOBILE
} else {
plannerModel->createTemporaryPlan();
+ plannerModel->recalcTemporaryPlan();
struct diveplan &diveplan = plannerModel->getDiveplan();
if (!diveplan.dp) {
plannerModel->deleteTemporaryPlan();