From 2e6688f42b5d464171b33e86abf3cd49d3dacd12 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Tue, 13 Mar 2012 03:49:02 +0100 Subject: [PATCH] * Use defaultPixmap() in TreeItemDelegate. --- src/libtomahawk/playlist/treeitemdelegate.cpp | 6 ++---- src/libtomahawk/playlist/treeitemdelegate.h | 4 ---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/libtomahawk/playlist/treeitemdelegate.cpp b/src/libtomahawk/playlist/treeitemdelegate.cpp index 685a6389e..c5c6f2377 100644 --- a/src/libtomahawk/playlist/treeitemdelegate.cpp +++ b/src/libtomahawk/playlist/treeitemdelegate.cpp @@ -39,9 +39,6 @@ TreeItemDelegate::TreeItemDelegate( ArtistView* parent, TreeProxyModel* proxy ) , m_view( parent ) , m_model( proxy ) { - m_nowPlayingIcon = QPixmap( RESPATH "images/now-playing-speaker.png" ); - m_defaultAlbumCover = QPixmap( RESPATH "images/no-album-no-case.png" ); - m_defaultArtistImage = QPixmap( RESPATH "images/no-artist-image-placeholder.png" ); } @@ -112,7 +109,8 @@ TreeItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, if ( item->isPlaying() && m_view->header()->visualIndex( index.column() ) == 0 ) { r.adjust( 0, 0, 0, -3 ); - painter->drawPixmap( r.adjusted( 3, 1, 18 - r.width(), 1 ), m_nowPlayingIcon ); + QRect npr = r.adjusted( 3, 1, 18 - r.width(), 1 ); + painter->drawPixmap( npr, TomahawkUtils::defaultPixmap( TomahawkUtils::NowPlayingSpeaker, TomahawkUtils::Original, npr.size() ) ); r.adjust( 25, 0, 0, 3 ); } diff --git a/src/libtomahawk/playlist/treeitemdelegate.h b/src/libtomahawk/playlist/treeitemdelegate.h index da84fcec9..2ed8b42d3 100644 --- a/src/libtomahawk/playlist/treeitemdelegate.h +++ b/src/libtomahawk/playlist/treeitemdelegate.h @@ -42,10 +42,6 @@ protected: private: ArtistView* m_view; TreeProxyModel* m_model; - - QPixmap m_nowPlayingIcon; - QPixmap m_defaultAlbumCover; - QPixmap m_defaultArtistImage; }; #endif // TREEITEMDELEGATE_H