From 32eae51128597addfd6a42d02d246cd407824f95 Mon Sep 17 00:00:00 2001 From: Matthew Krafczyk Date: Tue, 9 Sep 2014 17:07:40 +0200 Subject: [PATCH] Made isEmpty function name more specific. Moved doubleclick fix to restoreJournallingState. --- include/JournallingObject.h | 6 ++++-- src/gui/widgets/knob.cpp | 5 +---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/JournallingObject.h b/include/JournallingObject.h index c3a93a1cd..441d27220 100644 --- a/include/JournallingObject.h +++ b/include/JournallingObject.h @@ -50,7 +50,9 @@ public: void restoreJournallingState() { - m_journalling = m_journallingStateStack.pop(); + if( !isJournallingStackEmpty()) { + m_journalling = m_journallingStateStack.pop(); + } } void addJournalCheckPoint(); @@ -77,7 +79,7 @@ public: return oldJournalling; } - inline bool isEmpty() const + inline bool isJournallingStackEmpty() const { return m_journallingStateStack.isEmpty(); } diff --git a/src/gui/widgets/knob.cpp b/src/gui/widgets/knob.cpp index 141ae143f..7bb226795 100644 --- a/src/gui/widgets/knob.cpp +++ b/src/gui/widgets/knob.cpp @@ -592,10 +592,7 @@ void knob::mouseReleaseEvent( QMouseEvent* event ) AutomatableModel *thisModel = model(); if( thisModel ) { - if( !thisModel->isEmpty() ) - { - thisModel->restoreJournallingState(); - } + thisModel->restoreJournallingState(); } }