mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 06:07:37 +02:00
Queue up the next track in a station if the user manually removes the last one
This commit is contained in:
@@ -141,15 +141,18 @@ DynamicModel::newTrackLoading()
|
||||
}
|
||||
|
||||
void
|
||||
DynamicModel::removeIndex(const QModelIndex& index, bool moreToCome)
|
||||
DynamicModel::removeIndex(const QModelIndex& idx, bool moreToCome)
|
||||
{
|
||||
if ( m_playlist->mode() == Static && isReadOnly() )
|
||||
return;
|
||||
|
||||
if( m_playlist->mode() == OnDemand )
|
||||
TrackModel::removeIndex( index );
|
||||
else
|
||||
PlaylistModel::removeIndex( index, moreToCome );
|
||||
if( m_playlist->mode() == OnDemand ) {
|
||||
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
|
||||
newTrackLoading();
|
||||
}
|
||||
TrackModel::removeIndex( idx );
|
||||
} else
|
||||
PlaylistModel::removeIndex( idx, moreToCome );
|
||||
// don't call onPlaylistChanged.
|
||||
|
||||
if( !moreToCome )
|
||||
|
Reference in New Issue
Block a user