From 4f66b0775778c153c2a5445b5e603e2857d7a38f Mon Sep 17 00:00:00 2001 From: Jean-Philippe Andre Date: Sat, 13 Sep 2008 16:55:29 -0400 Subject: [PATCH 1/1] Qt coverlabel should always show an image, even when load fails --- modules/gui/qt4/components/interface_widgets.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/gui/qt4/components/interface_widgets.cpp b/modules/gui/qt4/components/interface_widgets.cpp index 4edc1271f9..c63a3ac35b 100644 --- a/modules/gui/qt4/components/interface_widgets.cpp +++ b/modules/gui/qt4/components/interface_widgets.cpp @@ -1517,7 +1517,17 @@ void CoverArtLabel::doUpdate() { QString artUrl = qfu( psz_meta ).replace( "file://", "" ); 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(); if( !artActions.isEmpty() ) { -- 2.39.2