diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2014-05-29 23:49:43 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-05-29 20:39:02 -0700 |
commit | 221b1a9e0165b2a103f7cc818fe3eb655e095e38 (patch) | |
tree | 707bc6654d22b33ef890847d728dd48375c16987 /qt-ui/diveplanner.cpp | |
parent | 2744714970c6953bed8ae10fd1c00d05b68966f2 (diff) | |
download | subsurface-221b1a9e0165b2a103f7cc818fe3eb655e095e38.tar.gz |
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 <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/diveplanner.cpp')
-rw-r--r-- | qt-ui/diveplanner.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
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(); |