From 40c35f2092364576495fafaeb2f335dcbe6e908d Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Sun, 9 Feb 2014 18:47:51 -0200 Subject: [PATCH] Update AutomationEditor.cpp A better way to update the play button icons, which requires less "if" checks and method calls in total. --- src/gui/AutomationEditor.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/gui/AutomationEditor.cpp b/src/gui/AutomationEditor.cpp index 31e582a7c..b48f2b582 100644 --- a/src/gui/AutomationEditor.cpp +++ b/src/gui/AutomationEditor.cpp @@ -489,22 +489,15 @@ void AutomationEditor::loadSettings( const QDomElement & _this ) -void AutomationEditor::updatePlayPauseIcon() +void AutomationEditor::setPauseIcon( bool pause ) { - if( engine::getSong()->playMode() != song::Mode_PlayPattern ) + if( pause == true ) { - m_playButton->setIcon( embed::getIconPixmap( "play" ) ); + m_playButton->setIcon( embed::getIconPixmap( "pause" ) ); } else { - if( engine::getSong()->isPlaying() ) - { - m_playButton->setIcon( embed::getIconPixmap( "pause" ) ); - } - else - { - m_playButton->setIcon( embed::getIconPixmap( "play" ) ); - } + m_playButton->setIcon( embed::getIconPixmap( "play" ) ); } }