subsurface/desktop-widgets/undocommands.h
Berthold Stoeger 574065b314 Cleanup: reinstate override modifiers
This reverts commit 1c4a859c8d,
where the override modifiers were removed owing to the noisy
"inconsistent override modifiers" which is default-on in clang.

This warning was disabled in 77577f717f,
so we can reinstate the overrides.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-29 15:23:25 -07:00

51 lines
1.1 KiB
C++

// SPDX-License-Identifier: GPL-2.0
#ifndef UNDOCOMMANDS_H
#define UNDOCOMMANDS_H
#include <QUndoCommand>
#include <QMap>
class UndoDeleteDive : public QUndoCommand {
public:
UndoDeleteDive(QList<struct dive*> deletedDives);
void undo() override;
void redo() override;
private:
QList<struct dive*> diveList;
QList<struct dive_trip*> tripList;
};
class UndoShiftTime : public QUndoCommand {
public:
UndoShiftTime(QList<int> changedDives, int amount);
void undo() override;
void redo() override;
private:
QList<int> diveList;
int timeChanged;
};
class UndoRenumberDives : public QUndoCommand {
public:
UndoRenumberDives(QMap<int, QPair<int, int> > originalNumbers);
void undo() override;
void redo() override;
private:
QMap<int,QPair<int, int> > oldNumbers;
};
class UndoRemoveDivesFromTrip : public QUndoCommand {
public:
UndoRemoveDivesFromTrip(QMap<struct dive*, dive_trip*> removedDives);
void undo() override;
void redo() override;
private:
QMap<struct dive*, dive_trip*> divesToUndo;
QList<struct dive_trip*> tripList;
};
#endif // UNDOCOMMANDS_H