Commit 4f66b077 authored by Jean-Philippe Andre's avatar Jean-Philippe Andre

Qt coverlabel should always show an image, even when load fails

parent 6f85cf97
...@@ -1517,7 +1517,17 @@ void CoverArtLabel::doUpdate() ...@@ -1517,7 +1517,17 @@ void CoverArtLabel::doUpdate()
{ {
QString artUrl = qfu( psz_meta ).replace( "file://", "" ); QString artUrl = qfu( psz_meta ).replace( "file://", "" );
if( artUrl != prevArt ) if( artUrl != prevArt )
setPixmap( QPixmap( artUrl ) ); {
QPixmap pix;
if( pix.load( artUrl ) )
setPixmap( pix );
else
{
msg_Dbg( p_this, "Qt could not load image '%s'",
qtu( artUrl ) );
setPixmap( QPixmap( ":/noart.png" ) );
}
}
QList< QAction* > artActions = actions(); QList< QAction* > artActions = actions();
if( !artActions.isEmpty() ) if( !artActions.isEmpty() )
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment