1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-05 13:47:26 +02:00

* Added coverLoaded() method to Query.

This commit is contained in:
Christian Muehlhaeuser
2012-05-27 17:34:03 +02:00
parent 9d064f7689
commit c5f6c25e93
2 changed files with 15 additions and 1 deletions

View File

@@ -780,7 +780,7 @@ Query::cover( const QSize& size, bool forceLoad ) const
} }
m_albumPtr->cover( size, forceLoad ); m_albumPtr->cover( size, forceLoad );
if ( m_albumPtr->infoLoaded() ) if ( m_albumPtr->coverLoaded() )
{ {
if ( !m_albumPtr->cover( size ).isNull() ) if ( !m_albumPtr->cover( size ).isNull() )
return m_albumPtr->cover( size ); return m_albumPtr->cover( size );
@@ -793,6 +793,19 @@ Query::cover( const QSize& size, bool forceLoad ) const
#endif #endif
bool
Query::coverLoaded() const
{
if ( m_albumPtr.isNull() )
return false;
if ( m_albumPtr->coverLoaded() && !m_albumPtr->cover( QSize( 0, 0 ) ).isNull() )
return true;
return m_artistPtr->coverLoaded();
}
QList<Tomahawk::query_ptr> QList<Tomahawk::query_ptr>
Query::similarTracks() const Query::similarTracks() const
{ {

View File

@@ -145,6 +145,7 @@ public:
#ifndef ENABLE_HEADLESS #ifndef ENABLE_HEADLESS
QPixmap cover( const QSize& size, bool forceLoad = true ) const; QPixmap cover( const QSize& size, bool forceLoad = true ) const;
#endif #endif
bool coverLoaded() const;
void setResolveFinished( bool resolved ) { m_resolveFinished = resolved; } void setResolveFinished( bool resolved ) { m_resolveFinished = resolved; }
void setPlayedBy( const Tomahawk::source_ptr& source, unsigned int playtime ); void setPlayedBy( const Tomahawk::source_ptr& source, unsigned int playtime );