From c6b5ea0380178df1ef84a016d1b79dce9a39db0a Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Sun, 8 Apr 2012 18:30:29 -0400 Subject: [PATCH] Covers aren't showing up now...but at least we're not pegging CPU. Will continue to fix in a bit --- src/libtomahawk/utils/PixmapDelegateFader.cpp | 14 ++++++-------- src/libtomahawk/widgets/FadingPixmap.cpp | 1 - 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/libtomahawk/utils/PixmapDelegateFader.cpp b/src/libtomahawk/utils/PixmapDelegateFader.cpp index 5b4637be8..c1c34cd53 100644 --- a/src/libtomahawk/utils/PixmapDelegateFader.cpp +++ b/src/libtomahawk/utils/PixmapDelegateFader.cpp @@ -105,8 +105,6 @@ PixmapDelegateFader::init() { m_current = QPixmap( m_size ); m_current.fill( Qt::transparent ); - - stlInstance().data()->setUpdateInterval( 20 ); if ( m_currentReference.isNull() ) { @@ -135,7 +133,7 @@ PixmapDelegateFader::albumChanged() if ( m_album.isNull() ) return; - setPixmap( m_album->cover( m_size ) ); + QMetaObject::invokeMethod( this, "setPixmap", Qt::QueuedConnection, Q_ARG( QPixmap, m_album->cover( m_size ) ) ); } void @@ -144,7 +142,7 @@ PixmapDelegateFader::artistChanged() if ( m_artist.isNull() ) return; - setPixmap( m_artist->cover( m_size ) ); + QMetaObject::invokeMethod( this, "setPixmap", Qt::QueuedConnection, Q_ARG( QPixmap, m_artist->cover( m_size ) ) ); } @@ -154,7 +152,7 @@ PixmapDelegateFader::trackChanged() if ( m_track.isNull() ) return; - setPixmap( m_track->cover( m_size ) ); + QMetaObject::invokeMethod( this, "setPixmap", Qt::QueuedConnection, Q_ARG( QPixmap, m_track->cover( m_size ) ) ); } @@ -179,10 +177,11 @@ PixmapDelegateFader::setPixmap( const QPixmap& pixmap ) m_pixmapQueue.enqueue( pixmap ); return; } - + m_oldReference = m_currentReference; m_currentReference = pixmap; + stlInstance().data()->setUpdateInterval( 20 ); m_startFrame = stlInstance().data()->currentFrame(); m_connectedToStl = true; m_fadePct = 0; @@ -270,13 +269,12 @@ void PixmapDelegateFader::onAnimationFinished() { m_oldReference = QPixmap(); - onAnimationStep( INT_MAX ); m_connectedToStl = false; disconnect( stlInstance().data(), SIGNAL( frameChanged( int ) ), this, SLOT( onAnimationStep( int ) ) ); if ( !m_pixmapQueue.isEmpty() ) - setPixmap( m_pixmapQueue.dequeue() ); + QMetaObject::invokeMethod( this, "setPixmap", Qt::QueuedConnection, Q_ARG( QPixmap, m_pixmapQueue.dequeue() ) ); } diff --git a/src/libtomahawk/widgets/FadingPixmap.cpp b/src/libtomahawk/widgets/FadingPixmap.cpp index 7b3cfe7d2..e6054751b 100644 --- a/src/libtomahawk/widgets/FadingPixmap.cpp +++ b/src/libtomahawk/widgets/FadingPixmap.cpp @@ -141,7 +141,6 @@ FadingPixmap::mouseReleaseEvent( QMouseEvent* event ) void FadingPixmap::paintEvent( QPaintEvent* event ) { - tDebug() << Q_FUNC_INFO; Q_UNUSED( event ); QPainter p( this );