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 --- desktop-widgets/mainwindow.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'desktop-widgets') diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index 9d2b31136..d995c7a36 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -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(); -- cgit v1.2.3-70-g09d2