diff --git a/src/libtomahawk/Query.cpp b/src/libtomahawk/Query.cpp index 1c4702376..8f67295c8 100644 --- a/src/libtomahawk/Query.cpp +++ b/src/libtomahawk/Query.cpp @@ -241,6 +241,8 @@ void Query::refreshResults() { Q_D( Query ); + + clearResults(); if ( d->resolveFinished && d->allowReresolve ) { d->resolveFinished = false; @@ -287,6 +289,21 @@ Query::removeResult( const Tomahawk::result_ptr& result ) } +void +Query::clearResults() +{ + Q_D( Query ); + { + QMutexLocker lock( &d->mutex ); + d->results.clear(); + } + + d->solved = false; + d->playable = false; + emit resultsChanged(); +} + + void Query::onResolvingFinished() { @@ -478,16 +495,6 @@ Query::disallowReresolve() } -void -Query::clearResults() -{ - foreach( const result_ptr& rp, results() ) - { - removeResult( rp ); - } -} - - void Query::checkResults() {