[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:10:27 CEST 2008


vlc | branch: 0.9-bugfix | Jean-Philippe Andre <jpeg at via.ecp.fr> | Sat Sep 13 16:55:29 2008 -0400| [9238437d74133d85c0b7f9c9e57135b841968657] | committer: Antoine Cellerier 

Qt coverlabel should always show an image, even when load fails
(cherry picked from commit 4f66b0775778c153c2a5445b5e603e2857d7a38f)

Signed-off-by: Antoine Cellerier <dionoea at videolan.org>

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

 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 b5767c3..777da16 100644
--- a/modules/gui/qt4/components/interface_widgets.cpp
+++ b/modules/gui/qt4/components/interface_widgets.cpp
@@ -1524,7 +1524,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