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.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/muse2/muse/undo.cpp b/muse2/muse/undo.cpp
index 2b90e26f..2a11c3dc 100644
--- a/muse2/muse/undo.cpp
+++ b/muse2/muse/undo.cpp
@@ -14,6 +14,8 @@
#include "song.h"
#include "globals.h"
+#include <QAction>
+
// iundo points to last Undo() in Undo-list
static bool undoMode = false; // for debugging
@@ -201,12 +203,21 @@ void Song::endUndo(int flags)
}
-void Song::applyOperationGroup(Undo& group)
+void Song::applyOperationGroup(Undo& group, bool doUndo)
+{
+ if (!group.empty())
{
- //this is a HACK! but it works :) (added by flo93)
- redoList->push_back(group);
- redo();
+ //this is a HACK! but it works :) (added by flo93)
+ redoList->push_back(group);
+ redo();
+
+ if (!doUndo)
+ {
+ undoList->pop_back();
+ undoAction->setEnabled(!undoList->empty());
+ }
}
+}