]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/interface_widgets.cpp
Qt coverlabel should always show an image, even when load fails
[vlc] / modules / gui / qt4 / components / interface_widgets.cpp
index 4edc1271f91c44feda4f082077a18eb5f04039f4..c63a3ac35b48909951e655c92b28cfc4b24ccf5a 100644 (file)
@@ -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() )
             {