mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-07 14:46:33 +02:00
make stations behave when multiple result signals are emitted by the pipeline
This commit is contained in:
@@ -84,6 +84,7 @@ DynamicModel::newTrackGenerated( const Tomahawk::query_ptr& query )
|
|||||||
if( m_onDemandRunning ) {
|
if( m_onDemandRunning ) {
|
||||||
connect( query.data(), SIGNAL( resolvingFinished( bool ) ), this, SLOT( trackResolveFinished( bool ) ) );
|
connect( query.data(), SIGNAL( resolvingFinished( bool ) ), this, SLOT( trackResolveFinished( bool ) ) );
|
||||||
|
|
||||||
|
m_waitingFor << query.data();
|
||||||
append( query );
|
append( query );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -112,7 +113,10 @@ DynamicModel::trackResolveFinished( bool success )
|
|||||||
{
|
{
|
||||||
Q_UNUSED( success );
|
Q_UNUSED( success );
|
||||||
|
|
||||||
Query* q = qobject_cast<Query*>(sender());
|
Query* q = qobject_cast<Query*>( sender() );
|
||||||
|
|
||||||
|
if( !m_waitingFor.contains( q ) )
|
||||||
|
return;
|
||||||
|
|
||||||
if( !q->playable() ) {
|
if( !q->playable() ) {
|
||||||
qDebug() << "Got not resolved track:" << q->track() << q->artist() << m_lastResolvedRow << m_currentAttempts;
|
qDebug() << "Got not resolved track:" << q->track() << q->artist() << m_lastResolvedRow << m_currentAttempts;
|
||||||
@@ -139,6 +143,7 @@ DynamicModel::trackResolveFinished( bool success )
|
|||||||
|
|
||||||
emit checkForOverflow();
|
emit checkForOverflow();
|
||||||
}
|
}
|
||||||
|
m_waitingFor.removeAll( q );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -74,11 +74,15 @@ private:
|
|||||||
void addToPlaylist( const QList< query_ptr >& entries, bool clearFirst );
|
void addToPlaylist( const QList< query_ptr >& entries, bool clearFirst );
|
||||||
|
|
||||||
dynplaylist_ptr m_playlist;
|
dynplaylist_ptr m_playlist;
|
||||||
|
|
||||||
// for filtering unresolvable
|
// for filtering unresolvable
|
||||||
int m_limitResolvedTo;
|
int m_limitResolvedTo;
|
||||||
QList< query_ptr > m_toResolveList;
|
QList< query_ptr > m_toResolveList;
|
||||||
QList< query_ptr > m_resolvedList;
|
QList< query_ptr > m_resolvedList;
|
||||||
|
|
||||||
|
// for managing upcoming queue
|
||||||
|
QList< Query* > m_waitingFor;
|
||||||
|
|
||||||
bool m_onDemandRunning;
|
bool m_onDemandRunning;
|
||||||
bool m_changeOnNext;
|
bool m_changeOnNext;
|
||||||
bool m_searchingForNext;
|
bool m_searchingForNext;
|
||||||
|
Reference in New Issue
Block a user