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

- 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) ...@@ -367,16 +367,15 @@ PlaylistItem *Playlist::nextItem(PlaylistItem *current, bool random)
PlaylistItem *Playlist::previousItem(PlaylistItem *current, bool random) PlaylistItem *Playlist::previousItem(PlaylistItem *current, bool random)
{ {
if(!current) if(!current)
return 0; return 0;
if(random && !m_history.isEmpty()) if(random && !m_history.isEmpty())
return m_history.pop(); return m_history.pop();
else {
if(!current->itemAbove()) if(!current->itemAbove())
return current; return current;
else
return static_cast<PlaylistItem *>(current->itemAbove()); return static_cast<PlaylistItem *>(current->itemAbove());
}
} }
QString Playlist::name() const 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