summaryrefslogtreecommitdiff
path: root/muse2/muse/undo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'muse2/muse/undo.cpp')
-rw-r--r--muse2/muse/undo.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/muse2/muse/undo.cpp b/muse2/muse/undo.cpp
index 2a11c3dc..c57bb5c1 100644
--- a/muse2/muse/undo.cpp
+++ b/muse2/muse/undo.cpp
@@ -186,6 +186,9 @@ void UndoList::clearDelete()
void Song::startUndo()
{
+ redoList->clear(); // added by flo93: redo must be invalidated when
+ redoAction->setEnabled(false); // a new undo is started
+
undoList->push_back(Undo());
updateFlags = 0;
undoMode = true;
@@ -203,7 +206,7 @@ void Song::endUndo(int flags)
}
-void Song::applyOperationGroup(Undo& group, bool doUndo)
+bool Song::applyOperationGroup(Undo& group, bool doUndo)
{
if (!group.empty())
{
@@ -216,7 +219,16 @@ void Song::applyOperationGroup(Undo& group, bool doUndo)
undoList->pop_back();
undoAction->setEnabled(!undoList->empty());
}
+ else
+ {
+ redoList->clear(); // added by flo93: redo must be invalidated when
+ redoAction->setEnabled(false); // a new undo is started
+ }
+
+ return doUndo;
}
+ else
+ return false;
}