aboutsummaryrefslogtreecommitdiffstats
path: root/qt-models/cylindermodel.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-02-23 12:44:09 +0100
committerGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-04-07 00:13:34 +0200
commit30d289e4a8a0caadcf30f06872ce69f44cf0bc0d (patch)
tree79a37c61c945995875f63d6e1e49e8e99d76814c /qt-models/cylindermodel.h
parentaa7b0cadb2f737e65d490f4ad026f5df09a394f0 (diff)
downloadsubsurface-30d289e4a8a0caadcf30f06872ce69f44cf0bc0d.tar.gz
CylinderModel: make dive dynamic
The CylinderModel always accessed the global "displayed_dive" and in some special cases also "current_dive". To implement cylinder undo, the model should work on an arbitrary dive. Therefore, in analogy to the weight model, make the dive dynamic. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models/cylindermodel.h')
-rw-r--r--qt-models/cylindermodel.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/qt-models/cylindermodel.h b/qt-models/cylindermodel.h
index 5cfe72d2d..201459b72 100644
--- a/qt-models/cylindermodel.h
+++ b/qt-models/cylindermodel.h
@@ -41,7 +41,7 @@ public:
void add();
void clear();
- void updateDive();
+ void updateDive(dive *d);
void updateDecoDepths(pressure_t olddecopo2);
void updateTrashIcon();
void moveAtFirst(int cylid);
@@ -56,6 +56,7 @@ slots:
void cylindersReset(const QVector<dive *> &dives);
private:
+ dive *d;
int rows;
cylinder_t *cylinderAt(const QModelIndex &index);
};
@@ -69,7 +70,7 @@ public:
void clear();
void add();
- void updateDive();
+ void updateDive(dive *d);
public
slots:
void remove(QModelIndex index);