From 3b6b9951ae0595c21dc35d95126e644babbfbc2d Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 16 Nov 2019 22:00:25 +0100 Subject: undo: clear undo-stack when clearing dive data When the dive data is cleared, all pointers in the undo-stack become stale. Desktop explicitly called Command::clear() in that case, but mobile doesn't. Thus, move the clear() call into DiveTripModelBase::clear() Signed-off-by: Berthold Stoeger --- qt-models/divetripmodel.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'qt-models') diff --git a/qt-models/divetripmodel.cpp b/qt-models/divetripmodel.cpp index 6c1a7218a..a9fd3490b 100644 --- a/qt-models/divetripmodel.cpp +++ b/qt-models/divetripmodel.cpp @@ -467,6 +467,7 @@ void DiveTripModelBase::initSelection() void DiveTripModelBase::clear() { + Command::clear(); // If we clear the dive list, all undo-information becomes stalte. beginResetModel(); clear_dive_file_data(); clearData(); -- cgit v1.2.3-70-g09d2