From 58f2e5f77c2faaf4c2f75767ee8fde67cc0931ac Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 30 Mar 2019 18:39:27 +0100 Subject: Undo: use QUndoStack::isClean() to determine unsaved changes Properly implement the unsaved-changes flag(s). Since we currently have two kinds of changes, there are two flags: 1) dive_list_changed in divelist.c marks non-undoable changes. This flag is only cleared on save or load. 2) QUndoStack::isClean() is used to determine the state of undoable changes. Every time the user returns to the state where they saved, this flag is cleared. Signed-off-by: Berthold Stoeger --- desktop-widgets/command_edit.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'desktop-widgets/command_edit.cpp') diff --git a/desktop-widgets/command_edit.cpp b/desktop-widgets/command_edit.cpp index 7ff714e8f..31d34a89b 100644 --- a/desktop-widgets/command_edit.cpp +++ b/desktop-widgets/command_edit.cpp @@ -92,8 +92,6 @@ void EditBase::undo() if (setSelection(selectedDives, current)) emit diveListNotifier.selectionChanged(); // If the selection changed -> tell the frontend - - mark_divelist_changed(true); } // We have to manually instantiate the constructors of the EditBase class, @@ -509,8 +507,6 @@ void EditTagsBase::undo() if (setSelection(selectedDives, current)) emit diveListNotifier.selectionChanged(); // If the selection changed -> tell the frontend - - mark_divelist_changed(true); } // Undo and redo do the same as just the stored value is exchanged -- cgit v1.2.3-70-g09d2