mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +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 ) {
|
||||
connect( query.data(), SIGNAL( resolvingFinished( bool ) ), this, SLOT( trackResolveFinished( bool ) ) );
|
||||
|
||||
m_waitingFor << query.data();
|
||||
append( query );
|
||||
}
|
||||
}
|
||||
@@ -112,7 +113,10 @@ DynamicModel::trackResolveFinished( bool 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() ) {
|
||||
qDebug() << "Got not resolved track:" << q->track() << q->artist() << m_lastResolvedRow << m_currentAttempts;
|
||||
@@ -139,6 +143,7 @@ DynamicModel::trackResolveFinished( bool success )
|
||||
|
||||
emit checkForOverflow();
|
||||
}
|
||||
m_waitingFor.removeAll( q );
|
||||
}
|
||||
|
||||
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user