diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2021-02-25 22:20:26 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2021-04-02 13:53:23 -0700 |
commit | 4b801f1f50e0ca78d92673e92f9f05f22514f2d7 (patch) | |
tree | ce85c1adb808ae64dff7ce1ff2eabe4365b73de6 /qt-models/diveplannermodel.h | |
parent | 7b9c8e344a490333196c34fe87235146872b662e (diff) | |
download | subsurface-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 'qt-models/diveplannermodel.h')
-rw-r--r-- | qt-models/diveplannermodel.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/qt-models/diveplannermodel.h b/qt-models/diveplannermodel.h index 9b79232d6..70f06b7c6 100644 --- a/qt-models/diveplannermodel.h +++ b/qt-models/diveplannermodel.h @@ -92,6 +92,7 @@ slots: void remove(const QModelIndex &index); void cancelPlan(); void createTemporaryPlan(); + void recalcTemporaryPlan(); // Writes the plan into the dive. void deleteTemporaryPlan(); void emitDataChanged(); void setRebreatherMode(int mode); |