Undo/redo of dive deletion needs to handle trips as well

If we delete dives that were part of a trip, that trip may get deleted as
well. So if we undo that operation we need to bring back the trip, too.

This also deals with a bug in the original code that did the delete both
in calling code (in divelistview.cpp) and in the redo function. Because of
the nature of the delete this didn't really matter but it is of course
wrong and with the new code it would in fact cause an issue.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-10-02 14:50:12 -04:00
parent 7c427dcc02
commit a94c84d598
3 changed files with 41 additions and 13 deletions

View file

@ -13,6 +13,7 @@ public:
private:
QList<struct dive*> diveList;
QList<struct dive_trip*> tripList;
};
class UndoShiftTime : public QUndoCommand {