From aec7a0b1406297cb2f25d186f6f3b919bd703dff Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Wed, 4 Apr 2012 16:41:00 +0200 Subject: [PATCH] * Fixed crash in AudioControls. (merge) --- src/audiocontrols.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/audiocontrols.cpp b/src/audiocontrols.cpp index de5fa1306..ba5ffa823 100644 --- a/src/audiocontrols.cpp +++ b/src/audiocontrols.cpp @@ -362,8 +362,12 @@ void AudioControls::onPlaybackTimer( qint64 msElapsed ) { const int seconds = msElapsed / 1000; - ui->timeLabel->setText( TomahawkUtils::timeToString( seconds ) ); - ui->timeLeftLabel->setText( "-" + TomahawkUtils::timeToString( m_currentTrack->duration() - seconds ) ); + if ( seconds != m_lastTextSecondShown && !m_currentTrack.isNull() ) + { + ui->timeLabel->setText( TomahawkUtils::timeToString( seconds ) ); + ui->timeLeftLabel->setText( "-" + TomahawkUtils::timeToString( m_currentTrack->duration() - seconds ) ); + m_lastTextSecondShown = seconds; + } //tDebug( LOGEXTRA ) << Q_FUNC_INFO << "msElapsed =" << msElapsed << "and timer current time =" << m_sliderTimeLine.currentTime() << "and m_seekMsecs =" << m_seekMsecs; if ( msElapsed > 0 && msElapsed != m_lastSliderCheck && m_seekMsecs == -1 && msElapsed - 500 < m_lastSliderCheck )