mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-26 07:14:47 +02:00
* Query::equals() can now ignore album names.
This commit is contained in:
@@ -490,18 +490,18 @@ Query::checkResults()
|
||||
|
||||
|
||||
bool
|
||||
Query::equals( const Tomahawk::query_ptr& other, bool ignoreCase ) const
|
||||
Query::equals( const Tomahawk::query_ptr& other, bool ignoreCase, bool ignoreAlbum ) const
|
||||
{
|
||||
if ( other.isNull() )
|
||||
return false;
|
||||
|
||||
if ( ignoreCase )
|
||||
return ( queryTrack()->artist().toLower() == other->queryTrack()->artist().toLower() &&
|
||||
queryTrack()->album().toLower() == other->queryTrack()->album().toLower() &&
|
||||
( ignoreAlbum || queryTrack()->album().toLower() == other->queryTrack()->album().toLower() ) &&
|
||||
queryTrack()->track().toLower() == other->queryTrack()->track().toLower() );
|
||||
else
|
||||
return ( queryTrack()->artist() == other->queryTrack()->artist() &&
|
||||
queryTrack()->album() == other->queryTrack()->album() &&
|
||||
( ignoreAlbum || queryTrack()->album() == other->queryTrack()->album() ) &&
|
||||
queryTrack()->track() == other->queryTrack()->track() );
|
||||
}
|
||||
|
||||
|
@@ -51,7 +51,7 @@ public:
|
||||
|
||||
virtual ~Query();
|
||||
|
||||
bool equals( const Tomahawk::query_ptr& other, bool ignoreCase = false ) const;
|
||||
bool equals( const Tomahawk::query_ptr& other, bool ignoreCase = false, bool ignoreAlbum = false ) const;
|
||||
float howSimilar( const Tomahawk::result_ptr& r );
|
||||
|
||||
QVariant toVariant() const;
|
||||
|
Reference in New Issue
Block a user