From def4fdb391f5207ebbe61881416f39f3d896cc5d Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Sun, 22 May 2011 13:29:19 +0000 Subject: - 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) --- muse2/muse/undo.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'muse2/muse/undo.cpp') 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 + // 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()); + } } +} -- cgit v1.2.3