From 221b1a9e0165b2a103f7cc818fe3eb655e095e38 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Thu, 29 May 2014 23:49:43 -0300 Subject: Do not remove a Deco Stop by clicking on the trash This patch forbids deletion of the Deco Stop from the QTableView that holds the model. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/diveplanner.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'qt-ui/diveplanner.cpp') diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index c243c1528..957097507 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -656,6 +656,10 @@ void DivePlannerPointsModel::remove(const QModelIndex &index) if (index.column() != REMOVE) return; + divedatapoint dp = at(index.row()); + if (!dp.entered) + return; + beginRemoveRows(QModelIndex(), index.row(), index.row()); divepoints.remove(index.row()); endRemoveRows(); -- cgit v1.2.3-70-g09d2