|
From: Tapio V. <aa...@us...> - 2011-02-04 08:58:16
|
Module: editor
Branch: master
Commit: 5ef73b8807c1f3ee84c8fcf8992f61e1378deb0a
Author: Tapio Vierros <tap...@gm...>
Date: Fri Feb 4 10:48:14 2011 +0200
Fix note splitting.
---
notelabelmanager.cc | 8 ++++++--
operation.hh | 2 +-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/notelabelmanager.cc b/notelabelmanager.cc
index 2783dae..66a850e 100644
--- a/notelabelmanager.cc
+++ b/notelabelmanager.cc
@@ -85,7 +85,10 @@ void NoteLabelManager::split(NoteLabel *note, float ratio)
new2 << id+1 << secondst << n.begin + n.length() * ratio << n.end << n.note << note->isFloating();
Operation del("DEL"); del << id+2;
Operation combiner("COMBINER"); combiner << 3; // This will combine the previous ones to one undo action
- doOperation(new1); doOperation(new2); doOperation(del); doOperation(combiner);
+ doOperation(new1, Operation::NO_UPDATE);
+ doOperation(new2, Operation::NO_UPDATE);
+ doOperation(del, Operation::NO_UPDATE);
+ doOperation(combiner);
}
void NoteLabelManager::del(NoteLabel *note)
@@ -219,7 +222,8 @@ void NoteLabelManager::doOperation(const Operation& op, Operation::OperationFlag
n->createPixmap(n->size());
}
}
- updateNotes();
+ if (!(flags & Operation::NO_UPDATE))
+ updateNotes();
}
if (!(flags & Operation::NO_EMIT)) {
emit operationDone(op);
diff --git a/operation.hh b/operation.hh
index 7b25ff5..b00a841 100644
--- a/operation.hh
+++ b/operation.hh
@@ -8,7 +8,7 @@
struct Operation
{
- enum OperationFlags { NORMAL = 0, NO_EXEC = 1, NO_EMIT = 2 };
+ enum OperationFlags { NORMAL = 0, NO_EXEC = 1, NO_EMIT = 2, NO_UPDATE = 4 };
Operation() { }
Operation(const QString &opString) { *this << opString; }
|