]> git.sesse.net Git - vlc/commitdiff
Qt: cache "no-art" pixmap as well
authorJakob Leben <jleben@videolan.org>
Thu, 18 Feb 2010 01:53:27 +0000 (02:53 +0100)
committerJakob Leben <jleben@videolan.org>
Thu, 18 Feb 2010 01:53:27 +0000 (02:53 +0100)
modules/gui/qt4/components/playlist/icon_view.cpp

index 9b8d1f183322df734d558044429b0d1af233729b..38f2f92db63ad43ababc75784334d9edc9482016 100644 (file)
@@ -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
         {