mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-10 16:14:40 +02:00
Disallow re-resolving of DatabaseCollection Tracks
This commit is contained in:
@@ -212,7 +212,7 @@ void
|
|||||||
Query::refreshResults()
|
Query::refreshResults()
|
||||||
{
|
{
|
||||||
Q_D( Query );
|
Q_D( Query );
|
||||||
if ( d->resolveFinished )
|
if ( d->resolveFinished && d->allowReresolve )
|
||||||
{
|
{
|
||||||
d->resolveFinished = false;
|
d->resolveFinished = false;
|
||||||
query_ptr q = d->ownRef.toStrongRef();
|
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
|
void
|
||||||
Query::clearResults()
|
Query::clearResults()
|
||||||
{
|
{
|
||||||
|
@@ -82,6 +82,18 @@ public:
|
|||||||
|
|
||||||
void setResolveFinished( bool resolved );
|
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 );
|
void setSaveHTTPResultHint( bool saveResultHint );
|
||||||
bool saveHTTPResultHint() const;
|
bool saveHTTPResultHint() const;
|
||||||
|
|
||||||
|
@@ -18,6 +18,7 @@ public:
|
|||||||
|
|
||||||
QueryPrivate( Query* q, const track_ptr& track, const QID& _qid )
|
QueryPrivate( Query* q, const track_ptr& track, const QID& _qid )
|
||||||
: q_ptr( q )
|
: q_ptr( q )
|
||||||
|
, allowReresolve( true )
|
||||||
, qid( _qid )
|
, qid( _qid )
|
||||||
, queryTrack( track )
|
, queryTrack( track )
|
||||||
{
|
{
|
||||||
@@ -25,6 +26,7 @@ public:
|
|||||||
|
|
||||||
QueryPrivate( Query* q, const QString& query, const QID& _qid )
|
QueryPrivate( Query* q, const QString& query, const QID& _qid )
|
||||||
: q_ptr( q )
|
: q_ptr( q )
|
||||||
|
, allowReresolve( true )
|
||||||
, qid( _qid )
|
, qid( _qid )
|
||||||
, fullTextQuery( query )
|
, fullTextQuery( query )
|
||||||
{
|
{
|
||||||
@@ -40,6 +42,7 @@ private:
|
|||||||
bool solved;
|
bool solved;
|
||||||
bool playable;
|
bool playable;
|
||||||
bool resolveFinished;
|
bool resolveFinished;
|
||||||
|
bool allowReresolve;
|
||||||
mutable QID qid;
|
mutable QID qid;
|
||||||
|
|
||||||
QString fullTextQuery;
|
QString fullTextQuery;
|
||||||
|
@@ -161,6 +161,8 @@ DatabaseCommand_AllTracks::exec( DatabaseImpl* dbi )
|
|||||||
results << result;
|
results << result;
|
||||||
qry->addResults( results );
|
qry->addResults( results );
|
||||||
qry->setResolveFinished( true );
|
qry->setResolveFinished( true );
|
||||||
|
// These tracks are fixed to the Source. Do not re-resolve.
|
||||||
|
qry->disallowReresolve();
|
||||||
|
|
||||||
ql << qry;
|
ql << qry;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user