mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-02-21 01:46:11 +01:00
Add an isResolving() function to Pipeline
This commit is contained in:
parent
1719a17325
commit
759ad2cfa4
@ -240,6 +240,13 @@ Pipeline::resolve( const QList<query_ptr>& qlist, bool prioritized, bool tempora
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
Pipeline::isResolving( const query_ptr& q ) const
|
||||||
|
{
|
||||||
|
return m_qids.contains( q->id() ) && m_qidsState.contains( q->id() );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Pipeline::resolve( const query_ptr& q, bool prioritized, bool temporaryQuery )
|
Pipeline::resolve( const query_ptr& q, bool prioritized, bool temporaryQuery )
|
||||||
{
|
{
|
||||||
@ -275,13 +282,13 @@ Pipeline::reportResults( QID qid, const QList< result_ptr >& results )
|
|||||||
Q_ASSERT( !q.isNull() );
|
Q_ASSERT( !q.isNull() );
|
||||||
if ( q.isNull() )
|
if ( q.isNull() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QList< result_ptr > cleanResults;
|
QList< result_ptr > cleanResults;
|
||||||
foreach ( const result_ptr& r, results )
|
foreach ( const result_ptr& r, results )
|
||||||
{
|
{
|
||||||
if ( r.isNull() )
|
if ( r.isNull() )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
float score = q->howSimilar( r );
|
float score = q->howSimilar( r );
|
||||||
r->setScore( score );
|
r->setScore( score );
|
||||||
if ( !q->isFullTextQuery() && score < MINSCORE )
|
if ( !q->isFullTextQuery() && score < MINSCORE )
|
||||||
|
@ -77,6 +77,8 @@ public:
|
|||||||
return m_rids.value( rid );
|
return m_rids.value( rid );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isResolving( const query_ptr& q ) const;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void resolve( const query_ptr& q, bool prioritized = true, bool temporaryQuery = false );
|
void resolve( const query_ptr& q, bool prioritized = true, bool temporaryQuery = false );
|
||||||
void resolve( const QList<query_ptr>& qlist, bool prioritized = true, bool temporaryQuery = false );
|
void resolve( const QList<query_ptr>& qlist, bool prioritized = true, bool temporaryQuery = false );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user