1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-06 14:16:32 +02:00

* Be more consistent when enabling the prev/next buttons.

This commit is contained in:
Christian Muehlhaeuser
2012-11-28 12:54:48 +01:00
parent 23fb6aec56
commit 5b213f1ac4

View File

@@ -191,6 +191,9 @@ PlayableProxyModelPlaylistInterface::siblingIndex( int itemsAway, qint64 rootInd
} }
else else
{ {
if ( !proxyModel->currentIndex().isValid() )
return -1;
// random mode is enabled // random mode is enabled
if ( m_shuffleCache.isValid() ) if ( m_shuffleCache.isValid() )
{ {
@@ -207,7 +210,7 @@ PlayableProxyModelPlaylistInterface::siblingIndex( int itemsAway, qint64 rootInd
item = proxyModel->itemFromIndex( proxyModel->mapToSource( idx ) ); item = proxyModel->itemFromIndex( proxyModel->mapToSource( idx ) );
} }
while ( safetyCounter < proxyModel->rowCount() && while ( safetyCounter < proxyModel->rowCount() &&
( !item || !item->query()->playable() || m_shuffleHistory.contains( item->query() ) ) ); ( !item || !item->query()->playable() || m_shuffleHistory.contains( item->query() ) ) );
if ( item && item->query()->playable() ) if ( item && item->query()->playable() )
{ {
@@ -252,6 +255,9 @@ PlayableProxyModelPlaylistInterface::siblingIndex( int itemsAway, qint64 rootInd
if ( !idx.isValid() && m_repeatMode == PlaylistModes::RepeatAll ) if ( !idx.isValid() && m_repeatMode == PlaylistModes::RepeatAll )
{ {
if ( !proxyModel->currentIndex().isValid() )
return -1;
// repeat all tracks // repeat all tracks
if ( itemsAway > 0 ) if ( itemsAway > 0 )
{ {