1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 07:49:42 +01:00

* Don't get stuck searching for another item if the TreeModel is empty.

This commit is contained in:
Christian Muehlhaeuser 2011-11-04 08:05:27 +01:00
parent 56cb000130
commit 2f5ebd2071

View File

@ -329,9 +329,9 @@ TreeProxyModel::siblingItem( int itemsAway )
Tomahawk::result_ptr
TreeProxyModel::siblingItem( int itemsAway, bool readOnly )
{
qDebug() << Q_FUNC_INFO;
QModelIndex idx = currentIndex();
if ( !idx.isValid() )
return Tomahawk::result_ptr();
if ( m_shuffled )
idx = index( qrand() % rowCount( idx.parent() ), 0, idx.parent() );