summaryrefslogtreecommitdiff
path: root/muse2/muse/undo.cpp
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2011-06-03 14:24:08 +0000
committerFlorian Jung <flo@windfisch.org>2011-06-03 14:24:08 +0000
commitdb164b62e3892bd17d1a2eabca76bde3b67072df (patch)
treeab71ac4b4f05ab94c008d75ef7052bef5af6cc74 /muse2/muse/undo.cpp
parentdef4fdb391f5207ebbe61881416f39f3d896cc5d (diff)
parent9187899632c14d64b3fae6477b7f941240f912a6 (diff)
merged with trunk and adapted new functions
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;
}