-bool PLModel::canEdit() const
-{
- return (
- rootItem != NULL &&
- (
- rootItem->p_input == p_playlist->p_playing->p_input ||
- (
- p_playlist->p_media_library &&
- rootItem->p_input == p_playlist->p_media_library->p_input
- )
- )
- );
+ /* Lookup in the QPixmapCache */
+ if( !QPixmapCache::find( key, artPix ))
+ {
+ if( artUrl.isEmpty() || !artPix.load( artUrl ) )
+ {
+ 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
+ {
+ artPix = artPix.scaled( size, Qt::KeepAspectRatio, Qt::SmoothTransformation );
+ QPixmapCache::insert( key, artPix );
+ }
+ }
+
+ return artPix;