Changeset c49f0446 in subsurface


Ignore:
Timestamp:
Jan 23, 2017, 10:11:51 PM (4 weeks ago)
Author:
Subsurface <dirk@…>
Branches:
master
Children:
b0ec714
Parents:
c1dc0c9
git-author:
Robert C. Helling <helling@…> (01/23/17 09:11:52)
git-committer:
Subsurface <dirk@…> (01/23/17 22:11:51)
Message:

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@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • qt-models/diveplannermodel.cpp

    rc1dc0c9 rc49f0446  
    77#include "core/device.h"
    88#include "core/subsurface-qt/SettingsObjectWrapper.h"
     9#include <QApplication>
    910
    1011/* TODO: Port this to CleanerTableModel to remove a bit of boilerplate and
     
    701702 * removed rows, and remove those in a go.
    702703 */
    703 //      int i;
    704 //      int rows = rowCount();
    705 //      if (QApplication::keyboardModifiers() & Qt::ControlModifier) {
    706 //              beginRemoveRows(QModelIndex(), index.row(), rows - 1);
    707 //              for (i = rows - 1; i >= index.row(); i--)
    708 //                      divepoints.remove(i);
    709 //      } else {
     704        int i;
     705        int rows = rowCount();
     706        if (QApplication::keyboardModifiers() & Qt::ControlModifier) {
     707                beginRemoveRows(QModelIndex(), index.row(), rows - 1);
     708                for (i = rows - 1; i >= index.row(); i--)
     709                        divepoints.remove(i);
     710        } else {
    710711                beginRemoveRows(QModelIndex(), index.row(), index.row());
    711712                divepoints.remove(index.row());
    712 //      }
     713        }
    713714        endRemoveRows();
    714715}
Note: See TracChangeset for help on using the changeset viewer.