Commit 15db09bc authored by Frerich Raabe's avatar Frerich Raabe

- Refactored this chunk of conditional logic so that tired minds like mine

  can tell what's going on, too.

svn path=/trunk/kdemultimedia/juk/; revision=217720
parent 8a1f339b
......@@ -367,16 +367,15 @@ PlaylistItem *Playlist::nextItem(PlaylistItem *current, bool random)
PlaylistItem *Playlist::previousItem(PlaylistItem *current, bool random)
{
if(!current)
return 0;
return 0;
if(random && !m_history.isEmpty())
return m_history.pop();
else {
if(!current->itemAbove())
return current;
else
return static_cast<PlaylistItem *>(current->itemAbove());
}
return m_history.pop();
if(!current->itemAbove())
return current;
return static_cast<PlaylistItem *>(current->itemAbove());
}
QString Playlist::name() const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment