diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-11-03 15:04:48 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-12-05 10:14:25 -0800 |
commit | b3f530bfb9d099414d833e7b0eb8c71cb3780eca (patch) | |
tree | 879112df23e236e93e80cf4a726504fb7dccf09c /qt-models/weightmodel.cpp | |
parent | b3253304a59b85c76f8a70f20ada4139e715a5b3 (diff) | |
download | subsurface-b3f530bfb9d099414d833e7b0eb8c71cb3780eca.tar.gz |
Undo: make weight-deletion an undoable action
This one is a bit more complicated than weight adding, because the
multiple-dive case is not well defined. If multiple dives are selected,
this implementation will search for weights that are identical to the
weight deleted in the currently shown dive. The position of the weight
in the list is ignored.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models/weightmodel.cpp')
-rw-r--r-- | qt-models/weightmodel.cpp | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/qt-models/weightmodel.cpp b/qt-models/weightmodel.cpp index ceac7617c..ff0b5c87a 100644 --- a/qt-models/weightmodel.cpp +++ b/qt-models/weightmodel.cpp @@ -29,17 +29,6 @@ weightsystem_t *WeightModel::weightSystemAt(const QModelIndex &index) return &d->weightsystems.weightsystems[index.row()]; } -void WeightModel::remove(QModelIndex index) -{ - if (index.column() != REMOVE || !d) - return; - beginRemoveRows(QModelIndex(), index.row(), index.row()); - rows--; - remove_weightsystem(d, index.row()); - changed = true; - endRemoveRows(); -} - void WeightModel::clear() { updateDive(nullptr); @@ -96,7 +85,6 @@ void WeightModel::passInData(const QModelIndex &index, const QVariant &value) } } - bool WeightModel::setData(const QModelIndex &index, const QVariant &value, int role) { QString vString = value.toString(); |