Commit 9238437d authored by Jean-Philippe Andre's avatar Jean-Philippe Andre Committed by Antoine Cellerier

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

(cherry picked from commit 4f66b077)
Signed-off-by: default avatarAntoine Cellerier <dionoea@videolan.org>
parent 430c2f2d
...@@ -1524,7 +1524,17 @@ void CoverArtLabel::doUpdate() ...@@ -1524,7 +1524,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