summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/undocommands.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-07-18 19:31:59 +0200
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2018-07-19 02:43:08 +0300
commit325b8bba35c339d626071b3feedbc6140774a725 (patch)
tree9f10fbd96cec6dcd3a64e6580438f03ccd8a1943 /desktop-widgets/undocommands.h
parentb51e616b6a2af91f63cfa32d641d5898b10314ff (diff)
downloadsubsurface-325b8bba35c339d626071b3feedbc6140774a725.tar.gz
Undo: remember deleted trip in UndoRemoveDivesFromTrip::undo()
If the last dive of a trip is removed, the trip is deleted. On redo the dive is added to a non existing trip, leading to a segfault. Therefore, keep a copy of the trip to reinstate it on redo. Note: this cannot work for a sequence of multiple commands. One would have to rewrite the whole undo-history. Nevertheless, let's do this as a stop-gap measure. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/undocommands.h')
-rw-r--r--desktop-widgets/undocommands.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/desktop-widgets/undocommands.h b/desktop-widgets/undocommands.h
index f0626377c..1403b23bb 100644
--- a/desktop-widgets/undocommands.h
+++ b/desktop-widgets/undocommands.h
@@ -45,6 +45,7 @@ public:
private:
QMap<struct dive*, dive_trip*> divesToUndo;
+ QList<struct dive_trip*> tripList;
};
#endif // UNDOCOMMANDS_H