1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-30 17:20:26 +02:00

only fetch more track if they are finished resolving and there are not enough tracks available yet

This commit is contained in:
Michael Zanetti
2012-07-15 13:18:37 +02:00
parent 68114e1f59
commit 885c52a042
3 changed files with 16 additions and 7 deletions

View File

@@ -50,7 +50,7 @@ Item {
id: delegateText
color: "white"
//text: controlModel.controlAt( index ).summary
text: "bla" + modelData
text: modelData
font.pixelSize: 28
anchors.verticalCenter: parent.verticalCenter
anchors.verticalCenterOffset: tagCloud.randomNumber(0, 15)

View File

@@ -146,18 +146,15 @@ void DynamicQmlWidget::nextTrackGenerated(const query_ptr &track)
m_model->tracksGenerated( QList<query_ptr>() << track );
m_playlist->resolve();
qDebug() << "next track generated" << m_proxyModel->rowCount() << m_proxyModel->currentIndex().row();
if( m_proxyModel->rowCount() <= m_proxyModel->currentIndex().row() + 8 ) {
qDebug() << "fetching next one";
m_playlist->generator()->fetchNext();
}
connect( track.data(), SIGNAL( resolvingFinished( bool )), SLOT( resolvingFinished( bool ) ) );
}
void DynamicQmlWidget::error(const QString &title, const QString &body)
{
qDebug() << "got a generator error:" << title << body;
m_playlist->generator()->fetchNext();
// m_playlist->generator()->fetchNext();
}
@@ -166,4 +163,14 @@ void DynamicQmlWidget::onRevisionLoaded(DynamicPlaylistRevision)
m_playlist->resolve();
}
void DynamicQmlWidget::resolvingFinished(bool hasResults)
{
Q_UNUSED(hasResults)
qDebug() << "next track generated" << m_proxyModel->rowCount() << m_proxyModel->currentIndex().row();
if( m_proxyModel->rowCount() <= m_proxyModel->currentIndex().row() + 8 ) {
qDebug() << "fetching next one";
m_playlist->generator()->fetchNext();
}
}
}

View File

@@ -59,6 +59,8 @@ private slots:
void error( const QString& title, const QString& body);
void onRevisionLoaded( Tomahawk::DynamicPlaylistRevision );
void resolvingFinished( bool hasResults );
private:
DynamicModel* m_model;
PlayableProxyModel* m_proxyModel;