diff options
author | Florian Jung <flo@windfisch.org> | 2011-05-22 13:29:19 +0000 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2011-05-22 13:29:19 +0000 |
commit | def4fdb391f5207ebbe61881416f39f3d896cc5d (patch) | |
tree | c761d3662c2dd78521317830dc35e0f91120416a /muse2/muse/undo.cpp | |
parent | 8fbfa07b464210054a177b1e92f47b5f2744d1cc (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.cpp | 19 |
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()); + } } +} |