1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-06 06:07:37 +02:00

make stations behave when multiple result signals are emitted by the pipeline

This commit is contained in:
Leo Franchi
2011-05-06 11:55:24 -04:00
parent 8c3745896c
commit 8b2ade25de
2 changed files with 26 additions and 17 deletions

View File

@@ -84,6 +84,7 @@ DynamicModel::newTrackGenerated( const Tomahawk::query_ptr& query )
if( m_onDemandRunning ) {
connect( query.data(), SIGNAL( resolvingFinished( bool ) ), this, SLOT( trackResolveFinished( bool ) ) );
m_waitingFor << query.data();
append( query );
}
}
@@ -114,6 +115,9 @@ DynamicModel::trackResolveFinished( bool success )
Query* q = qobject_cast<Query*>( sender() );
if( !m_waitingFor.contains( q ) )
return;
if( !q->playable() ) {
qDebug() << "Got not resolved track:" << q->track() << q->artist() << m_lastResolvedRow << m_currentAttempts;
m_currentAttempts++;
@@ -139,6 +143,7 @@ DynamicModel::trackResolveFinished( bool success )
emit checkForOverflow();
}
m_waitingFor.removeAll( q );
}

View File

@@ -74,11 +74,15 @@ private:
void addToPlaylist( const QList< query_ptr >& entries, bool clearFirst );
dynplaylist_ptr m_playlist;
// for filtering unresolvable
int m_limitResolvedTo;
QList< query_ptr > m_toResolveList;
QList< query_ptr > m_resolvedList;
// for managing upcoming queue
QList< Query* > m_waitingFor;
bool m_onDemandRunning;
bool m_changeOnNext;
bool m_searchingForNext;