mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
c1dc0c9ce0
commit
c49f044645
1 changed files with 9 additions and 8 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue