1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-11 00:24:12 +02:00

Queue up the next track in a station if the user manually removes the last one

This commit is contained in:
Leo Franchi
2011-02-08 18:10:04 -05:00
parent ec406e8f66
commit ffa6583be1

View File

@@ -141,15 +141,18 @@ DynamicModel::newTrackLoading()
} }
void void
DynamicModel::removeIndex(const QModelIndex& index, bool moreToCome) DynamicModel::removeIndex(const QModelIndex& idx, bool moreToCome)
{ {
if ( m_playlist->mode() == Static && isReadOnly() ) if ( m_playlist->mode() == Static && isReadOnly() )
return; return;
if( m_playlist->mode() == OnDemand ) if( m_playlist->mode() == OnDemand ) {
TrackModel::removeIndex( index ); if( !moreToCome && idx == index( rowCount( QModelIndex() ) - 1, 0, QModelIndex() ) ) { // if the user is manually removing the last one, re-add as we're a station
else newTrackLoading();
PlaylistModel::removeIndex( index, moreToCome ); }
TrackModel::removeIndex( idx );
} else
PlaylistModel::removeIndex( idx, moreToCome );
// don't call onPlaylistChanged. // don't call onPlaylistChanged.
if( !moreToCome ) if( !moreToCome )