mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-09 15:47:38 +02:00
Fix Result::toString to work with m_track == nullptr
This commit is contained in:
@@ -232,6 +232,8 @@ Result::toVariant() const
|
|||||||
|
|
||||||
QString
|
QString
|
||||||
Result::toString() const
|
Result::toString() const
|
||||||
|
{
|
||||||
|
if ( m_track )
|
||||||
{
|
{
|
||||||
return QString( "Result(%1, score: %2) %3 - %4%5 (%6)" )
|
return QString( "Result(%1, score: %2) %3 - %4%5 (%6)" )
|
||||||
.arg( id() )
|
.arg( id() )
|
||||||
@@ -240,6 +242,12 @@ Result::toString() const
|
|||||||
.arg( m_track->track() )
|
.arg( m_track->track() )
|
||||||
.arg( m_track->album().isEmpty() ? QString() : QString( " on %1" ).arg( m_track->album() ) )
|
.arg( m_track->album().isEmpty() ? QString() : QString( " on %1" ).arg( m_track->album() ) )
|
||||||
.arg( m_url );
|
.arg( m_url );
|
||||||
|
} else {
|
||||||
|
return QString( "Result(%1, score: %2) (%3)" )
|
||||||
|
.arg( id() )
|
||||||
|
.arg( m_score )
|
||||||
|
.arg( m_url );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user