diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-03-01 16:12:13 +0100 |
---|---|---|
committer | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-04-07 00:13:35 +0200 |
commit | 24a7dbde16ce5f024f6137a2318e54815a495a94 (patch) | |
tree | 13c62fa14c6f03e6cb74abaec40536de990e215a /qt-models/diveplannermodel.cpp | |
parent | 01fa983182062e00b2e661a963384289e4de1beb (diff) | |
download | subsurface-24a7dbde16ce5f024f6137a2318e54815a495a94.tar.gz |
CylindersModel: use flag to decide whether we are in planner
On desktop, we have two CylindersModel concurrently: One in the
planner and one on the equipment-tab. They act differently, because
the former modifies displayed_dive directly, the latter issues
undo commands.
To differentiate, we used the in_planner() function. However, that
appears extremely brittle, especially when combined with undo-commands.
Therefore when generating the model, pass in a parameter that says
whether this is for the planner or the equipment tab and use
that flag to decide how to act.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models/diveplannermodel.cpp')
-rw-r--r-- | qt-models/diveplannermodel.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp index 4928900c4..09d08c79a 100644 --- a/qt-models/diveplannermodel.cpp +++ b/qt-models/diveplannermodel.cpp @@ -415,6 +415,7 @@ int DivePlannerPointsModel::rowCount(const QModelIndex&) const } DivePlannerPointsModel::DivePlannerPointsModel(QObject *parent) : QAbstractTableModel(parent), + cylinders(true), mode(NOTHING), recalc(false) { |