From 325b8bba35c339d626071b3feedbc6140774a725 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Wed, 18 Jul 2018 19:31:59 +0200 Subject: 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 --- desktop-widgets/undocommands.h | 1 + 1 file changed, 1 insertion(+) (limited to 'desktop-widgets/undocommands.h') 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 divesToUndo; + QList tripList; }; #endif // UNDOCOMMANDS_H -- cgit v1.2.3-70-g09d2