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>
This commit is contained in:
Berthold Stoeger 2019-11-16 22:00:25 +01:00 committed by Dirk Hohndel
parent c8ec2f5b1c
commit 3b6b9951ae
2 changed files with 1 additions and 2 deletions

View file

@ -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();