mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 13:47:26 +02:00
* Don't get stuck searching for another item if the TreeModel is empty.
This commit is contained in:
@@ -329,9 +329,9 @@ TreeProxyModel::siblingItem( int itemsAway )
|
|||||||
Tomahawk::result_ptr
|
Tomahawk::result_ptr
|
||||||
TreeProxyModel::siblingItem( int itemsAway, bool readOnly )
|
TreeProxyModel::siblingItem( int itemsAway, bool readOnly )
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
|
||||||
|
|
||||||
QModelIndex idx = currentIndex();
|
QModelIndex idx = currentIndex();
|
||||||
|
if ( !idx.isValid() )
|
||||||
|
return Tomahawk::result_ptr();
|
||||||
|
|
||||||
if ( m_shuffled )
|
if ( m_shuffled )
|
||||||
idx = index( qrand() % rowCount( idx.parent() ), 0, idx.parent() );
|
idx = index( qrand() % rowCount( idx.parent() ), 0, idx.parent() );
|
||||||
|
Reference in New Issue
Block a user