Commit 5cfce2ef authored by Wilco Greven's avatar Wilco Greven

Fix a crash when filling the history popup in random play mode.

Let's hope QValueList gets a reverse iterator soon, so reverse iterating can be done more elegantly.

svn path=/trunk/kdemultimedia/juk/; revision=239524
parent 4945cf64
......@@ -320,10 +320,15 @@ PlaylistItemList Playlist::historyItems(PlaylistItem *current, bool random) cons
{
PlaylistItemList list;
if (random) {
if (random && !m_history.isEmpty()) {
PlaylistItemList::ConstIterator it = m_history.end();
--it;
for(int j = 0; it != m_history.begin() && j < 10; --it, ++j)
int j = 0;
for(; it != m_history.begin() && j < 10; --it, ++j)
list.append(*it);
if (j < 10)
list.append(*it);
}
else if(current) {
......
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