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

Fix Result::toString to work with m_track == nullptr

This commit is contained in:
Uwe L. Korn 2014-09-28 14:17:41 +01:00
parent 8562bcfe2b
commit 435770c557

View File

@ -233,13 +233,21 @@ Result::toVariant() const
QString
Result::toString() const
{
return QString( "Result(%1, score: %2) %3 - %4%5 (%6)" )
.arg( id() )
.arg( m_score )
.arg( m_track->artist() )
.arg( m_track->track() )
.arg( m_track->album().isEmpty() ? QString() : QString( " on %1" ).arg( m_track->album() ) )
.arg( m_url );
if ( m_track )
{
return QString( "Result(%1, score: %2) %3 - %4%5 (%6)" )
.arg( id() )
.arg( m_score )
.arg( m_track->artist() )
.arg( m_track->track() )
.arg( m_track->album().isEmpty() ? QString() : QString( " on %1" ).arg( m_track->album() ) )
.arg( m_url );
} else {
return QString( "Result(%1, score: %2) (%3)" )
.arg( id() )
.arg( m_score )
.arg( m_url );
}
}