diff options
author | Stefan Fuchs <sfuchs@gmx.de> | 2017-10-11 21:27:06 +0200 |
---|---|---|
committer | Robert C. Helling <helling@atdotde.de> | 2017-10-16 17:14:17 +0200 |
commit | 73d2ab8099ce08ab20f119a126334463ffd41b1e (patch) | |
tree | ba80715002dcbfbe8bc0aa029e99b881d3fa73f4 /qt-models/diveplannermodel.cpp | |
parent | df6933326de3ff173b2bd3458d8b29dce8c0f88f (diff) | |
download | subsurface-73d2ab8099ce08ab20f119a126334463ffd41b1e.tar.gz |
Update diveplannerpoints cylinderidx when deleting a cylinder
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Diffstat (limited to 'qt-models/diveplannermodel.cpp')
-rw-r--r-- | qt-models/diveplannermodel.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp index 57866b9e8..5fc692a38 100644 --- a/qt-models/diveplannermodel.cpp +++ b/qt-models/diveplannermodel.cpp @@ -353,6 +353,13 @@ void DivePlannerPointsModel::gaschange(const QModelIndex &index, int newcylinder emitDataChanged(); } +void DivePlannerPointsModel::cylinderRenumber(int mapping[]) +{ + for (int i = 0; i < rowCount(); i++) + divepoints[i].cylinderid = mapping[divepoints[i].cylinderid]; + emitDataChanged(); +} + QVariant DivePlannerPointsModel::headerData(int section, Qt::Orientation orientation, int role) const { if (role == Qt::DisplayRole && orientation == Qt::Horizontal) { |