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