1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-04-14 13:01:53 +02:00

fix stations to use new signals

This commit is contained in:
Leo Franchi 2011-02-03 17:30:39 -05:00
parent c09791d3df
commit e4d763089f
3 changed files with 16 additions and 14 deletions

View File

@ -135,13 +135,6 @@ Pipeline::reportResults( QID qid, const QList< result_ptr >& results )
unsigned int state = m_qidsState.value( qid ) - 1;
m_qidsState.insert( qid, state );
if ( state == 0 )
{
// All resolvers have reported back their results for this query now
const query_ptr& q = m_qids.value( qid );
q->onResolvingFinished();
}
if ( !results.isEmpty() )
{
//qDebug() << Q_FUNC_INFO << qid;
@ -155,6 +148,14 @@ Pipeline::reportResults( QID qid, const QList< result_ptr >& results )
m_rids.insert( r->id(), r );
}
}
if ( state == 0 )
{
// All resolvers have reported back their results for this query now
const query_ptr& q = m_qids.value( qid );
q->onResolvingFinished();
}
}

View File

@ -216,7 +216,6 @@ DynamicWidget::generateOrStart()
m_generateButton->setText( tr( "Stop" ) );
// show the steering controls
if( m_playlist->generator()->onDemandSteerable() ) {
// position it horizontally centered, above the botton.
@ -275,7 +274,7 @@ DynamicWidget::tracksGenerated( const QList< query_ptr >& queries )
void
DynamicWidget::onDemandFetched( const Tomahawk::query_ptr& track )
{
connect( track.data(), SIGNAL( resolveFailed() ), this, SLOT( trackResolveFailed() ) );
connect( track.data(), SIGNAL( resolvingFinished( bool ) ), this, SLOT( trackResolveFinished( bool ) ) );
connect( track.data(), SIGNAL( resultsAdded( QList<Tomahawk::result_ptr> ) ), this, SLOT( trackResolved() ) );
m_model->append( track );
@ -294,11 +293,13 @@ DynamicWidget::trackResolved()
}
void
DynamicWidget::trackResolveFailed()
DynamicWidget::trackResolveFinished( bool success )
{
m_songsSinceLastResolved++;
if( m_songsSinceLastResolved < 100 ) {
m_playlist->generator()->fetchNext();
if( !success ) { // if it was successful, we've already gotten a trackResolved() signal
m_songsSinceLastResolved++;
if( m_songsSinceLastResolved < 100 ) {
m_playlist->generator()->fetchNext();
}
}
}

View File

@ -72,7 +72,7 @@ private slots:
void onDemandFailed();
void newTrackLoading();
void onDemandFetched( const Tomahawk::query_ptr& track );
void trackResolveFailed();
void trackResolveFinished( bool );
void trackResolved();
void controlsChanged();