From d6d923d7280c0dbf64ded2dc7442f12965485b8b Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Mon, 13 Oct 2014 03:37:10 +0200 Subject: [PATCH] Defensive. --- src/libtomahawk/playlist/PlayableModel.cpp | 2 ++ .../playlist/PlayableProxyModelPlaylistInterface.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libtomahawk/playlist/PlayableModel.cpp b/src/libtomahawk/playlist/PlayableModel.cpp index 5f47de95d..d00ae45c6 100644 --- a/src/libtomahawk/playlist/PlayableModel.cpp +++ b/src/libtomahawk/playlist/PlayableModel.cpp @@ -627,6 +627,8 @@ void PlayableModel::clear() { Q_D( PlayableModel ); + setCurrentIndex( QModelIndex() ); + if ( rowCount( QModelIndex() ) ) { finishLoading(); diff --git a/src/libtomahawk/playlist/PlayableProxyModelPlaylistInterface.cpp b/src/libtomahawk/playlist/PlayableProxyModelPlaylistInterface.cpp index 438c93d8f..8f3ed39f3 100644 --- a/src/libtomahawk/playlist/PlayableProxyModelPlaylistInterface.cpp +++ b/src/libtomahawk/playlist/PlayableProxyModelPlaylistInterface.cpp @@ -205,7 +205,7 @@ PlayableProxyModelPlaylistInterface::siblingIndex( int itemsAway, qint64 rootInd else { // random mode is disabled - if ( rootIndex == -1 ) + if ( rootIndex <= 0 ) { idx = proxyModel->currentIndex(); }