diff options
Diffstat (limited to 'qt-models/diveplannermodel.cpp')
-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(); } |