From 18a1ed4c7df5a6e8e35a033e6ab33c6424024e4d Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Thu, 7 Jun 2012 09:37:28 +0200 Subject: [PATCH] * Less work for SourceDelegate now. --- src/sourcetree/SourceDelegate.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/sourcetree/SourceDelegate.cpp b/src/sourcetree/SourceDelegate.cpp index 4f2f35670..1f434a924 100644 --- a/src/sourcetree/SourceDelegate.cpp +++ b/src/sourcetree/SourceDelegate.cpp @@ -186,17 +186,10 @@ SourceDelegate::paintCollection( QPainter* painter, const QStyleOptionViewItem& QString text = painter->fontMetrics().elidedText( name, Qt::ElideRight, textRect.width() ); painter->drawText( textRect, text ); - bool isPlaying = false; - QString desc = status ? colItem->source()->textStatus() : tr( "Offline" ); + bool isPlaying = !( colItem->source()->currentTrack().isNull() ); + QString desc = colItem->source()->textStatus(); if ( colItem->source().isNull() ) desc = tr( "All available tracks" ); - if ( status && desc.isEmpty() && !colItem->source()->currentTrack().isNull() ) - { - desc = colItem->source()->currentTrack()->artist() + " - " + colItem->source()->currentTrack()->track(); - isPlaying = true; - } - if ( desc.isEmpty() ) - desc = tr( "Online" ); painter->setFont( normal ); textRect = option.rect.adjusted( iconRect.width() + 8, option.rect.height() / 2, -figWidth - 24, -6 );