1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-12 17:14:00 +02:00

* Fixed FadingPixmap isn't initialized with m_isDefault being true.

This commit is contained in:
Christian Muehlhaeuser
2012-07-06 07:36:43 +02:00
parent e521150d33
commit fbcffed27b
2 changed files with 7 additions and 17 deletions

View File

@@ -352,7 +352,7 @@ AudioControls::onPlaybackStopped()
ui->ownerLabel->setText( "" ); ui->ownerLabel->setText( "" );
ui->timeLabel->setText( "" ); ui->timeLabel->setText( "" );
ui->timeLeftLabel->setText( "" ); ui->timeLeftLabel->setText( "" );
ui->coverImage->setPixmap( QPixmap(), true ); ui->coverImage->setPixmap( QPixmap(), false );
ui->seekSlider->setVisible( false ); ui->seekSlider->setVisible( false );
m_sliderTimeLine.stop(); m_sliderTimeLine.stop();
m_sliderTimeLine.setCurrentTime( 0 ); m_sliderTimeLine.setCurrentTime( 0 );

View File

@@ -44,7 +44,7 @@ FadingPixmap::FadingPixmap( QWidget* parent )
, m_oldPixmap( QPixmap() ) , m_oldPixmap( QPixmap() )
, m_fadePct( 100 ) , m_fadePct( 100 )
, m_startFrame( 0 ) , m_startFrame( 0 )
, m_isDefault( true ) , m_isDefault( false )
{ {
// setCursor( Qt::PointingHandCursor ); // setCursor( Qt::PointingHandCursor );
} }
@@ -87,10 +87,8 @@ FadingPixmap::onAnimationFinished()
void void
FadingPixmap::setPixmap( const QPixmap& pixmap, bool isDefault ) FadingPixmap::setPixmap( const QPixmap& pixmap, bool isDefault )
{ {
tDebug() << Q_FUNC_INFO << "isDefault is " << ( isDefault ? "true" : "false" );
if ( !m_oldPixmap.isNull() && !isDefault ) if ( !m_oldPixmap.isNull() && !isDefault )
{ {
tDebug() << Q_FUNC_INFO << "adding pixmap to queue and clearing queue";
m_pixmapQueue.clear(); m_pixmapQueue.clear();
m_pixmapQueue << pixmap; m_pixmapQueue << pixmap;
if ( m_isDefault ) if ( m_isDefault )
@@ -99,10 +97,7 @@ FadingPixmap::setPixmap( const QPixmap& pixmap, bool isDefault )
} }
if ( m_isDefault && isDefault ) if ( m_isDefault && isDefault )
{
tDebug() << Q_FUNC_INFO << "moving from default to default, doing nothing";
return; return;
}
QByteArray ba; QByteArray ba;
QBuffer buffer( &ba ); QBuffer buffer( &ba );
@@ -110,13 +105,9 @@ FadingPixmap::setPixmap( const QPixmap& pixmap, bool isDefault )
pixmap.save( &buffer, "PNG" ); pixmap.save( &buffer, "PNG" );
QString newImageMd5 = TomahawkUtils::md5( buffer.data() ); QString newImageMd5 = TomahawkUtils::md5( buffer.data() );
if ( m_oldImageMd5 == newImageMd5 ) if ( m_oldImageMd5 == newImageMd5 )
{
tDebug() << Q_FUNC_INFO << "md5s match, doing nothing";
return; return;
}
m_oldImageMd5 = newImageMd5; m_oldImageMd5 = newImageMd5;
m_oldPixmap = m_pixmap; m_oldPixmap = m_pixmap;
m_pixmap = pixmap; m_pixmap = pixmap;
@@ -124,7 +115,6 @@ FadingPixmap::setPixmap( const QPixmap& pixmap, bool isDefault )
m_startFrame = stlInstance().data()->currentFrame(); m_startFrame = stlInstance().data()->currentFrame();
m_fadePct = 0; m_fadePct = 0;
m_isDefault = isDefault; m_isDefault = isDefault;
tDebug() << Q_FUNC_INFO << "connecting to timeline";
connect( stlInstance().data(), SIGNAL( frameChanged( int ) ), this, SLOT( onAnimationStep( int ) ) ); connect( stlInstance().data(), SIGNAL( frameChanged( int ) ), this, SLOT( onAnimationStep( int ) ) );
} }