]> git.sesse.net Git - vlc/commitdiff
Qt coverlabel should always show an image, even when load fails
authorJean-Philippe Andre <jpeg@via.ecp.fr>
Sat, 13 Sep 2008 20:55:29 +0000 (16:55 -0400)
committerJean-Philippe Andre <jpeg@via.ecp.fr>
Sat, 13 Sep 2008 21:01:45 +0000 (17:01 -0400)
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() )
             {