From 33ed1373e88cce0187eaea9604cccebc9071a061 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell <tomahawk@jefferai.org> Date: Sun, 19 Jun 2011 09:23:56 -0400 Subject: [PATCH] Simplify logic, de-duplicate --- src/libtomahawk/sourceplaylistinterface.cpp | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/libtomahawk/sourceplaylistinterface.cpp b/src/libtomahawk/sourceplaylistinterface.cpp index af197ea9d..3c68a5047 100644 --- a/src/libtomahawk/sourceplaylistinterface.cpp +++ b/src/libtomahawk/sourceplaylistinterface.cpp @@ -39,22 +39,7 @@ Tomahawk::result_ptr SourcePlaylistInterface::siblingItem( int itemsAway ) { Q_UNUSED( itemsAway ); - qDebug() << Q_FUNC_INFO; - if ( m_source.isNull() || m_source->currentTrack().isNull() || m_source->currentTrack()->results().isEmpty() ) - { - qDebug() << Q_FUNC_INFO << " Results were empty for current track or source no longer valid"; - m_currentItem = Tomahawk::result_ptr(); - return m_currentItem; - } - else if ( !m_gotNextSong ) - { - qDebug() << Q_FUNC_INFO << " This song was already fetched"; - return Tomahawk::result_ptr(); - } - - m_gotNextSong = false; - m_currentItem = m_source->currentTrack()->results().first(); - return m_currentItem; + return nextItem(); }