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:
@@ -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)
|
||||
|
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user