1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 03:10:12 +02:00

Show times in Latest Additions view, and make Recently Played safer

This commit is contained in:
Teo Mrnjavac
2013-09-27 14:33:18 +02:00
parent a0edbf1858
commit ab676a18ff

View File

@@ -225,6 +225,8 @@ PlaylistLargeItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem&
drawGenericBox( painter, opt, leftRect, timeString, sources );
}
else if ( m_mode == RecentlyPlayed )
{
if ( item->playbackLog().source )
{
QList< Tomahawk::source_ptr > sources;
sources << item->playbackLog().source;
@@ -233,6 +235,18 @@ PlaylistLargeItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem&
drawGenericBox( painter, opt, leftRect, playtime, sources );
}
}
else if ( m_mode == LatestAdditions )
{
if ( item->query()->numResults() )
{
QList< Tomahawk::source_ptr > sources;
QString modtime = TomahawkUtils::ageToString( QDateTime::fromTime_t( item->query()->results().first()->modificationTime() ), true );
drawGenericBox( painter, opt, leftRect, modtime, sources );
}
}
else
{
drawLoveBox( painter, leftRect, item, index );