mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
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:
parent
c8ec2f5b1c
commit
3b6b9951ae
2 changed files with 1 additions and 2 deletions
|
@ -547,7 +547,6 @@ void MainWindow::on_actionCloudstorageopen_triggered()
|
|||
if (!parse_file(fileNamePtr.data(), &dive_table, &trip_table, &dive_site_table))
|
||||
setCurrentFile(fileNamePtr.data());
|
||||
process_loaded_dives();
|
||||
Command::clear();
|
||||
hideProgressBar();
|
||||
refreshDisplay();
|
||||
}
|
||||
|
@ -1695,7 +1694,6 @@ void MainWindow::loadFiles(const QStringList fileNames)
|
|||
hideProgressBar();
|
||||
updateRecentFiles();
|
||||
process_loaded_dives();
|
||||
Command::clear();
|
||||
|
||||
refreshDisplay();
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue