mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 03:10:12 +02:00
* Fixed re-emitting idle() too often in Pipeline.
This commit is contained in:
@@ -220,7 +220,8 @@ Pipeline::shuntNext()
|
|||||||
|
|
||||||
if ( m_queries_pending.isEmpty() )
|
if ( m_queries_pending.isEmpty() )
|
||||||
{
|
{
|
||||||
emit idle();
|
if ( m_qidsState.isEmpty() )
|
||||||
|
emit idle();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -75,10 +75,7 @@ PlaylistModel::loadPlaylist( const Tomahawk::playlist_ptr& playlist, bool loadEn
|
|||||||
|
|
||||||
if ( rowCount( QModelIndex() ) && loadEntries )
|
if ( rowCount( QModelIndex() ) && loadEntries )
|
||||||
{
|
{
|
||||||
emit beginResetModel();
|
clear();
|
||||||
delete m_rootItem;
|
|
||||||
emit endResetModel();
|
|
||||||
m_rootItem = new PlItem( 0, this );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_playlist = playlist;
|
m_playlist = playlist;
|
||||||
@@ -125,10 +122,7 @@ PlaylistModel::loadHistory( const Tomahawk::source_ptr& source, unsigned int amo
|
|||||||
{
|
{
|
||||||
if ( rowCount( QModelIndex() ) )
|
if ( rowCount( QModelIndex() ) )
|
||||||
{
|
{
|
||||||
emit beginRemoveRows( QModelIndex(), 0, rowCount( QModelIndex() ) - 1 );
|
clear();
|
||||||
delete m_rootItem;
|
|
||||||
emit endRemoveRows();
|
|
||||||
m_rootItem = new PlItem( 0, this );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_playlist.clear();
|
m_playlist.clear();
|
||||||
@@ -149,9 +143,9 @@ PlaylistModel::clear()
|
|||||||
{
|
{
|
||||||
if ( rowCount( QModelIndex() ) )
|
if ( rowCount( QModelIndex() ) )
|
||||||
{
|
{
|
||||||
emit beginRemoveRows( QModelIndex(), 0, rowCount( QModelIndex() ) - 1 );
|
emit beginResetModel();
|
||||||
delete m_rootItem;
|
delete m_rootItem;
|
||||||
emit endRemoveRows();
|
emit endResetModel();
|
||||||
m_rootItem = new PlItem( 0, this );
|
m_rootItem = new PlItem( 0, this );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user