1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-04-13 12:31:52 +02:00

* Fixed re-emitting idle() too often in Pipeline.

This commit is contained in:
Christian Muehlhaeuser 2011-03-21 06:21:28 +01:00
parent c666aa4e91
commit f4269f0f34
2 changed files with 6 additions and 11 deletions

View File

@ -220,7 +220,8 @@ Pipeline::shuntNext()
if ( m_queries_pending.isEmpty() )
{
emit idle();
if ( m_qidsState.isEmpty() )
emit idle();
return;
}

View File

@ -75,10 +75,7 @@ PlaylistModel::loadPlaylist( const Tomahawk::playlist_ptr& playlist, bool loadEn
if ( rowCount( QModelIndex() ) && loadEntries )
{
emit beginResetModel();
delete m_rootItem;
emit endResetModel();
m_rootItem = new PlItem( 0, this );
clear();
}
m_playlist = playlist;
@ -125,10 +122,7 @@ PlaylistModel::loadHistory( const Tomahawk::source_ptr& source, unsigned int amo
{
if ( rowCount( QModelIndex() ) )
{
emit beginRemoveRows( QModelIndex(), 0, rowCount( QModelIndex() ) - 1 );
delete m_rootItem;
emit endRemoveRows();
m_rootItem = new PlItem( 0, this );
clear();
}
m_playlist.clear();
@ -149,9 +143,9 @@ PlaylistModel::clear()
{
if ( rowCount( QModelIndex() ) )
{
emit beginRemoveRows( QModelIndex(), 0, rowCount( QModelIndex() ) - 1 );
emit beginResetModel();
delete m_rootItem;
emit endRemoveRows();
emit endResetModel();
m_rootItem = new PlItem( 0, this );
}
}