summaryrefslogtreecommitdiff
path: root/muse2/muse/undo.cpp
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2011-05-22 13:29:19 +0000
committerFlorian Jung <flo@windfisch.org>2011-05-22 13:29:19 +0000
commitdef4fdb391f5207ebbe61881416f39f3d896cc5d (patch)
treec761d3662c2dd78521317830dc35e0f91120416a /muse2/muse/undo.cpp
parent8fbfa07b464210054a177b1e92f47b5f2744d1cc (diff)
- speeded up pasting, shrinking parts, drawing controllers in
the ctrlcanvas and reordering the drum list - applyOperationGroup() now doesn't apply empty opGroups any more - reordering the drum list doesn't cause undo be triggered any more - removed unneccessary song->update() calls after a song->applyOperationGroup() call - cleaned up (removed some commented out code blocks)
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());
+ }
}
+}