mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
Directly return when we know the final value
This commit is contained in:
@@ -263,17 +263,16 @@ PlayableProxyModel::nameFilterAcceptsRow( int sourceRow, PlayableItem* pi, const
|
|||||||
{
|
{
|
||||||
QStringList sl = filterRegExp().pattern().split( " ", QString::SkipEmptyParts );
|
QStringList sl = filterRegExp().pattern().split( " ", QString::SkipEmptyParts );
|
||||||
|
|
||||||
bool found = true;
|
|
||||||
foreach( const QString& s, sl )
|
foreach( const QString& s, sl )
|
||||||
{
|
{
|
||||||
if ( !al->name().contains( s, Qt::CaseInsensitive ) &&
|
if ( !al->name().contains( s, Qt::CaseInsensitive ) &&
|
||||||
!al->artist()->name().contains( s, Qt::CaseInsensitive ) )
|
!al->artist()->name().contains( s, Qt::CaseInsensitive ) )
|
||||||
{
|
{
|
||||||
found = false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return found;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Tomahawk::artist_ptr& ar = pi->artist();
|
const Tomahawk::artist_ptr& ar = pi->artist();
|
||||||
@@ -281,16 +280,15 @@ PlayableProxyModel::nameFilterAcceptsRow( int sourceRow, PlayableItem* pi, const
|
|||||||
{
|
{
|
||||||
QStringList sl = filterRegExp().pattern().split( " ", QString::SkipEmptyParts );
|
QStringList sl = filterRegExp().pattern().split( " ", QString::SkipEmptyParts );
|
||||||
|
|
||||||
bool found = true;
|
|
||||||
foreach( const QString& s, sl )
|
foreach( const QString& s, sl )
|
||||||
{
|
{
|
||||||
if ( !ar->name().contains( s, Qt::CaseInsensitive ) )
|
if ( !ar->name().contains( s, Qt::CaseInsensitive ) )
|
||||||
{
|
{
|
||||||
found = false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return found;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user