diff options
author | Robert C. Helling <helling@atdotde.de> | 2017-01-23 18:11:52 +0100 |
---|---|---|
committer | Subsurface <dirk@subsurface-divelog.org> | 2017-01-23 22:11:51 -0800 |
commit | c49f044645ec36e2103a307163d21da726541753 (patch) | |
tree | 64738d07d5c531ef0bf018b0d61f546d0ae57a75 /qt-models | |
parent | c1dc0c9ce0c0b8482dffba0b7becdec44d6f6bec (diff) | |
download | subsurface-c49f044645ec36e2103a307163d21da726541753.tar.gz |
Reenable Ctrl-Click to delet all further dive points in planner
This is needed to make "Edit dive in planner" work reasonable.
Partly undoes f432b764
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Diffstat (limited to 'qt-models')
-rw-r--r-- | qt-models/diveplannermodel.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp index 28941e2e9..5a06313f4 100644 --- a/qt-models/diveplannermodel.cpp +++ b/qt-models/diveplannermodel.cpp @@ -6,6 +6,7 @@ #include "qt-models/models.h" #include "core/device.h" #include "core/subsurface-qt/SettingsObjectWrapper.h" +#include <QApplication> /* TODO: Port this to CleanerTableModel to remove a bit of boilerplate and * use the signal warningMessage() to communicate errors to the MainWindow. @@ -700,16 +701,16 @@ void DivePlannerPointsModel::remove(const QModelIndex &index) * remove method that will pass the first and last index of the * removed rows, and remove those in a go. */ -// int i; -// int rows = rowCount(); -// if (QApplication::keyboardModifiers() & Qt::ControlModifier) { -// beginRemoveRows(QModelIndex(), index.row(), rows - 1); -// for (i = rows - 1; i >= index.row(); i--) -// divepoints.remove(i); -// } else { + int i; + int rows = rowCount(); + if (QApplication::keyboardModifiers() & Qt::ControlModifier) { + beginRemoveRows(QModelIndex(), index.row(), rows - 1); + for (i = rows - 1; i >= index.row(); i--) + divepoints.remove(i); + } else { beginRemoveRows(QModelIndex(), index.row(), index.row()); divepoints.remove(index.row()); -// } + } endRemoveRows(); } |