1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 07:49:42 +01:00

* Less work for SourceDelegate now.

This commit is contained in:
Christian Muehlhaeuser 2012-06-07 09:37:28 +02:00
parent 0d85d15002
commit 18a1ed4c7d

View File

@ -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 );