[vlc-devel] commit: Qt coverlabel should always show an image, even when load fails ( Jean-Philippe Andre )

git version control git at videolan.org
Sat Sep 13 23:07:12 CEST 2008


vlc | branch: master | Jean-Philippe Andre <jpeg at via.ecp.fr> | Sat Sep 13 16:55:29 2008 -0400| [4f66b0775778c153c2a5445b5e603e2857d7a38f] | committer: Jean-Philippe Andre 

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

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4f66b0775778c153c2a5445b5e603e2857d7a38f
---

 modules/gui/qt4/components/interface_widgets.cpp |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/modules/gui/qt4/components/interface_widgets.cpp b/modules/gui/qt4/components/interface_widgets.cpp
index 4edc127..c63a3ac 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() )
             {




More information about the vlc-devel mailing list