From 76a5a38f5e8aad339061f534df8130b426079a03 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 2 Nov 2019 18:47:56 +0100 Subject: Cleanup: remove displayed_dive from WeightModel The WeightModel always acted on the displayed dive. To support undo of weightsystem changes, operate on an arbitrary dive. This is in line with other models, where the updateDive() function resets the model to represent a certain dive. Signed-off-by: Berthold Stoeger --- qt-models/weightmodel.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'qt-models/weightmodel.h') diff --git a/qt-models/weightmodel.h b/qt-models/weightmodel.h index 21737a42c..444d8611e 100644 --- a/qt-models/weightmodel.h +++ b/qt-models/weightmodel.h @@ -25,7 +25,7 @@ public: void passInData(const QModelIndex &index, const QVariant &value); void add(); void clear(); - void updateDive(); + void updateDive(dive *d); weightsystem_t *weightSystemAt(const QModelIndex &index); bool changed; @@ -35,6 +35,7 @@ slots: void weightsystemsReset(const QVector &dives); private: + dive *d; int rows; }; -- cgit v1.2.3-70-g09d2