mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-09 07:36:48 +02:00
Return QPointer instead of casting around
This commit is contained in:
@@ -97,7 +97,7 @@ Api_v1_5::playback( QxtWebRequestEvent* event, const QString& command )
|
||||
QVariantMap trackInfo;
|
||||
trackInfo.insert( "playing", true );
|
||||
trackInfo.insert( "bitrate", currentTrack->bitrate() );
|
||||
if ( currentTrack->resolvedBy() != NULL ) {
|
||||
if ( !currentTrack->resolvedBy().isNull() ) {
|
||||
QString resolverName = currentTrack->resolvedBy()->name();
|
||||
trackInfo.insert( "resolvedBy", resolverName );
|
||||
} else {
|
||||
|
@@ -334,7 +334,7 @@ Pipeline::reportResults( QID qid, const QList< result_ptr >& results )
|
||||
return;
|
||||
if ( !d->qids.contains( qid ) )
|
||||
{
|
||||
if ( results.length() > 0 && results[0]->resolvedBy() != NULL )
|
||||
if ( results.length() > 0 && !results[0]->resolvedBy().isNull() )
|
||||
{
|
||||
tDebug() << "Result arrived too late for:" << qid << "by" << results[0]->resolvedBy()->name();
|
||||
}
|
||||
|
@@ -464,13 +464,10 @@ Result::setFileId( unsigned int id )
|
||||
}
|
||||
|
||||
|
||||
Tomahawk::Resolver*
|
||||
QPointer<Tomahawk::Resolver>
|
||||
Result::resolvedBy() const
|
||||
{
|
||||
if ( m_resolvedBy.isNull() )
|
||||
return 0;
|
||||
|
||||
return m_resolvedBy.data();
|
||||
return m_resolvedBy;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -62,7 +62,7 @@ public:
|
||||
QString toString() const;
|
||||
Tomahawk::query_ptr toQuery();
|
||||
|
||||
Tomahawk::Resolver* resolvedBy() const;
|
||||
QPointer<Tomahawk::Resolver> resolvedBy() const;
|
||||
void setResolvedBy( Tomahawk::Resolver* resolver );
|
||||
|
||||
float score() const;
|
||||
|
Reference in New Issue
Block a user