1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-10 08:04:25 +02:00

Disallow re-resolving of DatabaseCollection Tracks

This commit is contained in:
Uwe L. Korn
2014-07-17 00:58:50 +01:00
parent 4576f9a8d5
commit 1839b9a881
4 changed files with 34 additions and 1 deletions

View File

@@ -212,7 +212,7 @@ void
Query::refreshResults()
{
Q_D( Query );
if ( d->resolveFinished )
if ( d->resolveFinished && d->allowReresolve )
{
d->resolveFinished = false;
query_ptr q = d->ownRef.toStrongRef();
@@ -420,6 +420,22 @@ Query::setResolveFinished( bool resolved )
}
void
Query::allowReresolve()
{
Q_D( Query );
d->allowReresolve = true;
}
void
Query::disallowReresolve()
{
Q_D( Query );
d->allowReresolve = false;
}
void
Query::clearResults()
{

View File

@@ -82,6 +82,18 @@ public:
void setResolveFinished( bool resolved );
/**
* Allow contacting the Pipeline if the state of this Query changes to
* not solved.
*/
void allowReresolve();
/**
* Disallow contacting the Pipeline if the state of this Query changes to
* not solved.
*/
void disallowReresolve();
void setSaveHTTPResultHint( bool saveResultHint );
bool saveHTTPResultHint() const;

View File

@@ -18,6 +18,7 @@ public:
QueryPrivate( Query* q, const track_ptr& track, const QID& _qid )
: q_ptr( q )
, allowReresolve( true )
, qid( _qid )
, queryTrack( track )
{
@@ -25,6 +26,7 @@ public:
QueryPrivate( Query* q, const QString& query, const QID& _qid )
: q_ptr( q )
, allowReresolve( true )
, qid( _qid )
, fullTextQuery( query )
{
@@ -40,6 +42,7 @@ private:
bool solved;
bool playable;
bool resolveFinished;
bool allowReresolve;
mutable QID qid;
QString fullTextQuery;

View File

@@ -161,6 +161,8 @@ DatabaseCommand_AllTracks::exec( DatabaseImpl* dbi )
results << result;
qry->addResults( results );
qry->setResolveFinished( true );
// These tracks are fixed to the Source. Do not re-resolve.
qry->disallowReresolve();
ql << qry;
}