summaryrefslogtreecommitdiffstats
path: root/qt-models
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-11-16 22:00:25 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-03-10 09:25:49 -0700
commit3b6b9951ae0595c21dc35d95126e644babbfbc2d (patch)
tree756d9521e34bf73bbe31d80bca2c7878a119d2cf /qt-models
parentc8ec2f5b1ccd72d9ed5036bf9ecfec3b5f90964b (diff)
downloadsubsurface-3b6b9951ae0595c21dc35d95126e644babbfbc2d.tar.gz
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 <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models')
-rw-r--r--qt-models/divetripmodel.cpp1
1 files changed, 1 insertions, 0 deletions
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();