mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-09 23:57:34 +02:00
Disallow re-resolving of DatabaseCollection Tracks
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user