diff --git a/CHANGELOG.md b/CHANGELOG.md index d62abe272..ff1e802f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ - Desktop: Allow more than one media file to be imported from web +- undo: Clear undo stack when the current file is closed --- * Always add new entries at the very top of this file above other existing entries and this note. * Use this layout for new entries: `[Area]: [Details about the change] [reference thread / issue]` diff --git a/commands/command_base.cpp b/commands/command_base.cpp index 26855f0e6..745797643 100644 --- a/commands/command_base.cpp +++ b/commands/command_base.cpp @@ -1,5 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 +#include "command.h" #include "command_base.h" #include "core/globals.h" #include "core/qthelper.h" // for updateWindowTitle() @@ -18,6 +19,7 @@ void init() { undoStack = make_global(); QObject::connect(undoStack, &QUndoStack::cleanChanged, &updateWindowTitle); + QObject::connect(&diveListNotifier, &DiveListNotifier::dataReset, &Command::clear); changesCallback = &changesMade; } diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index 310148003..139d2fa68 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -513,7 +513,6 @@ void MainWindow::closeCurrentFile() if (!existing_filename) setTitle(); disableShortcuts(); - Command::setClean(); } void MainWindow::updateCloudOnlineStatus()