From c49f044645ec36e2103a307163d21da726541753 Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Mon, 23 Jan 2017 18:11:52 +0100 Subject: 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 --- qt-models/diveplannermodel.cpp | 17 +++++++++-------- 1 file 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 /* 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(); } -- cgit v1.2.3-70-g09d2