aboutsummaryrefslogtreecommitdiffstats
path: root/qt-models/diveplannermodel.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2021-01-26 07:48:22 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-04-02 13:53:23 -0700
commit1ec0790d504d8a9d5e6694afff04f9ae92d01af8 (patch)
treec799e7bdd7e20303f1030f771058c3561441e409 /qt-models/diveplannermodel.h
parente419ebf55a28d2483951e52ca274aedd96f11789 (diff)
downloadsubsurface-1ec0790d504d8a9d5e6694afff04f9ae92d01af8.tar.gz
planner: remove displayed_dive from DivePlannerModel
To remove global state, make the dive that DivePlannerModel works on a member variable. Pass the dive in createSimpleDive() and loadFromDive(). Moreover, this should pave the way to more fine-grained undo in the planner. Ultimately, the planner should not be modal. Attention: for now, the dive must still be displayed_dive, because of the convoluted way in which the profile and the planner work on the same dive. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models/diveplannermodel.h')
-rw-r--r--qt-models/diveplannermodel.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/qt-models/diveplannermodel.h b/qt-models/diveplannermodel.h
index 8cc12c5c8..5a5fc0155 100644
--- a/qt-models/diveplannermodel.h
+++ b/qt-models/diveplannermodel.h
@@ -39,7 +39,7 @@ public:
void removeSelectedPoints(const QVector<int> &rows);
void setPlanMode(Mode mode);
bool isPlanner() const;
- void createSimpleDive();
+ void createSimpleDive(struct dive *d);
Mode currentMode() const;
bool setRecalc(bool recalc);
bool recalcQ() const;
@@ -130,6 +130,7 @@ private:
void computeVariations(struct diveplan *diveplan, const struct deco_state *ds);
void computeVariationsFreeDeco(struct diveplan *diveplan, struct deco_state *ds);
int analyzeVariations(struct decostop *min, struct decostop *mid, struct decostop *max, const char *unit);
+ struct dive *d;
CylindersModel cylinders;
Mode mode;
bool recalc;