1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-17 19:37:09 +02:00

Defensive.

This commit is contained in:
Christian Muehlhaeuser
2014-10-13 03:37:10 +02:00
parent b2d20b66b7
commit d6d923d728
2 changed files with 3 additions and 1 deletions

View File

@@ -627,6 +627,8 @@ void
PlayableModel::clear() PlayableModel::clear()
{ {
Q_D( PlayableModel ); Q_D( PlayableModel );
setCurrentIndex( QModelIndex() );
if ( rowCount( QModelIndex() ) ) if ( rowCount( QModelIndex() ) )
{ {
finishLoading(); finishLoading();

View File

@@ -205,7 +205,7 @@ PlayableProxyModelPlaylistInterface::siblingIndex( int itemsAway, qint64 rootInd
else else
{ {
// random mode is disabled // random mode is disabled
if ( rootIndex == -1 ) if ( rootIndex <= 0 )
{ {
idx = proxyModel->currentIndex(); idx = proxyModel->currentIndex();
} }