From 73d2ab8099ce08ab20f119a126334463ffd41b1e Mon Sep 17 00:00:00 2001 From: Stefan Fuchs Date: Wed, 11 Oct 2017 21:27:06 +0200 Subject: Update diveplannerpoints cylinderidx when deleting a cylinder Signed-off-by: Stefan Fuchs --- qt-models/diveplannermodel.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'qt-models/diveplannermodel.cpp') 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) { -- cgit v1.2.3-70-g09d2