mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 03:10:12 +02:00
* Don't try to add an empty track-list to the playlist.
This commit is contained in:
@@ -66,23 +66,26 @@ PlaylistModel::loadPlaylist( const Tomahawk::playlist_ptr& playlist )
|
|||||||
|
|
||||||
PlItem* plitem;
|
PlItem* plitem;
|
||||||
QList<plentry_ptr> entries = playlist->entries();
|
QList<plentry_ptr> entries = playlist->entries();
|
||||||
int c = rowCount( QModelIndex() );
|
if ( entries.count() )
|
||||||
|
|
||||||
qDebug() << "starting loading" << playlist->title();
|
|
||||||
emit loadingStarts();
|
|
||||||
emit beginInsertRows( QModelIndex(), c, c + entries.count() - 1 );
|
|
||||||
|
|
||||||
foreach( const plentry_ptr& entry, entries )
|
|
||||||
{
|
{
|
||||||
qDebug() << entry->query()->toString();
|
int c = rowCount( QModelIndex() );
|
||||||
plitem = new PlItem( entry, m_rootItem );
|
|
||||||
plitem->index = createIndex( m_rootItem->children.count() - 1, 0, plitem );
|
|
||||||
|
|
||||||
connect( plitem, SIGNAL( dataChanged() ), SLOT( onDataChanged() ) );
|
qDebug() << "starting loading" << playlist->title();
|
||||||
|
emit loadingStarts();
|
||||||
|
emit beginInsertRows( QModelIndex(), c, c + entries.count() - 1 );
|
||||||
|
|
||||||
|
foreach( const plentry_ptr& entry, entries )
|
||||||
|
{
|
||||||
|
qDebug() << entry->query()->toString();
|
||||||
|
plitem = new PlItem( entry, m_rootItem );
|
||||||
|
plitem->index = createIndex( m_rootItem->children.count() - 1, 0, plitem );
|
||||||
|
|
||||||
|
connect( plitem, SIGNAL( dataChanged() ), SLOT( onDataChanged() ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
emit endInsertRows();
|
||||||
}
|
}
|
||||||
|
|
||||||
emit endInsertRows();
|
|
||||||
|
|
||||||
qDebug() << rowCount( QModelIndex() );
|
qDebug() << rowCount( QModelIndex() );
|
||||||
emit loadingFinished();
|
emit loadingFinished();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user