[vlc-devel] commit: Qt: cache "no-art" pixmap as well (Jakob Leben )
    git version control 
    git at videolan.org
       
    Thu Feb 18 02:54:18 CET 2010
    
    
  
vlc | branch: master | Jakob Leben <jleben at videolan.org> | Thu Feb 18 02:53:27 2010 +0100| [e261333922e24582216e37886d255ee2be7869b3] | committer: Jakob Leben 
Qt: cache "no-art" pixmap as well
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e261333922e24582216e37886d255ee2be7869b3
---
 modules/gui/qt4/components/playlist/icon_view.cpp |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/modules/gui/qt4/components/playlist/icon_view.cpp b/modules/gui/qt4/components/playlist/icon_view.cpp
index 9b8d1f1..38f2f92 100644
--- a/modules/gui/qt4/components/playlist/icon_view.cpp
+++ b/modules/gui/qt4/components/playlist/icon_view.cpp
@@ -82,7 +82,14 @@ QPixmap AbstractPlViewItemDelegate::getArtPixmap( const QModelIndex & index, con
     {
         if( artUrl.isEmpty() || !artPix.load( artUrl ) )
         {
-            artPix = QPixmap( ":/noart" ).scaled( size, Qt::KeepAspectRatio, Qt::SmoothTransformation );
+            key = QString("noart%1%2").arg(size.width()).arg(size.height());
+            if( !QPixmapCache::find( key, artPix ) )
+            {
+                artPix = QPixmap( ":/noart" ).scaled( size,
+                                                      Qt::KeepAspectRatio,
+                                                      Qt::SmoothTransformation );
+                QPixmapCache::insert( key, artPix );
+            }
         }
         else
         {
    
    
More information about the vlc-devel
mailing list