|
From: Tapio V. <aa...@us...> - 2011-02-24 17:11:58
|
Author: Tapio Vierros <tap...@gm...>
Date: Thu Feb 24 19:06:29 2011 +0200
No constant floating note updating when reapplying opStack.
---
editorapp.cc | 5 +++--
notegraphwidget.hh | 2 +-
notelabelmanager.cc | 2 +-
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/editorapp.cc b/editorapp.cc
index f325737..eb42c71 100644
--- a/editorapp.cc
+++ b/editorapp.cc
@@ -182,6 +182,7 @@ void EditorApp::doOpStack()
noteGraph->clearNotes();
QString newMusic = "";
OperationStack::iterator opit = opStack.begin();
+
// Re-apply all operations in the stack
while (opit != opStack.end()) {
//std::cout << "Doing op: " << opit->dump() << std::endl;
@@ -210,7 +211,7 @@ void EditorApp::doOpStack()
updateSongMeta(true);
} else // Regular note operations
- noteGraph->doOperation(*opit, Operation::NO_EMIT);
+ noteGraph->doOperation(*opit, Operation::NO_EMIT | Operation::NO_UPDATE);
} catch (std::exception& e) { std::cout << e.what() << std::endl; }
if (!erased) {
@@ -219,6 +220,7 @@ void EditorApp::doOpStack()
}
}
+ noteGraph->updateNotes();
if (!newMusic.isEmpty()) setMusic(newMusic);
updateMenuStates();
}
@@ -393,7 +395,6 @@ void EditorApp::openFile(QString fileName)
} catch (const std::exception& e) {
QMessageBox::critical(this, tr("Error loading file!"), e.what());
}
-
}
}
diff --git a/notegraphwidget.hh b/notegraphwidget.hh
index e587d3a..cb6b458 100644
--- a/notegraphwidget.hh
+++ b/notegraphwidget.hh
@@ -59,7 +59,7 @@ public:
void setLineBreak(NoteLabel *note, bool state);
void setType(NoteLabel *note, int newtype);
- void doOperation(const Operation& op, Operation::OperationFlags flags = Operation::NORMAL);
+ void doOperation(const Operation& op, int flags = Operation::NORMAL);
void zoom(float steps, double focalSecs = -1);
int getZoomLevel() const;
diff --git a/notelabelmanager.cc b/notelabelmanager.cc
index 16e30e7..5d3f95f 100644
--- a/notelabelmanager.cc
+++ b/notelabelmanager.cc
@@ -326,7 +326,7 @@ void NoteLabelManager::editLyric(NoteLabel *note) {
}
-void NoteLabelManager::doOperation(const Operation& op, Operation::OperationFlags flags)
+void NoteLabelManager::doOperation(const Operation& op, int flags)
{
if (!(flags & Operation::NO_EXEC)) {
try {
|