mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-20 07:49:42 +01:00
* Query::numResults( onlyPlayableResults ) lets you count only online results.
This commit is contained in:
parent
d36935a28e
commit
ae16fcda43
@ -322,10 +322,23 @@ Query::results() const
|
||||
|
||||
|
||||
unsigned int
|
||||
Query::numResults() const
|
||||
Query::numResults( bool onlyPlayableResults ) const
|
||||
{
|
||||
Q_D( const Query );
|
||||
QMutexLocker lock( &d->mutex );
|
||||
|
||||
if ( onlyPlayableResults )
|
||||
{
|
||||
unsigned int c = 0;
|
||||
foreach ( const result_ptr& result, d->results )
|
||||
{
|
||||
if ( result->isOnline() )
|
||||
c++;
|
||||
}
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
return d->results.length();
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,7 @@ public:
|
||||
QList< result_ptr > results() const;
|
||||
|
||||
/// how many results found so far?
|
||||
unsigned int numResults() const;
|
||||
unsigned int numResults( bool onlyPlayableResults = false ) const;
|
||||
|
||||
bool resolvingFinished() const;
|
||||
/// true when a perfect result has been found (score of 1.0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user