Commit acd606b1 authored by Michael Pyne's avatar Michael Pyne

Don't add the currently playing item twice when the user shows the Play Queue.

svn path=/trunk/kdemultimedia/juk/; revision=360914
parent 5a3bc7be
...@@ -47,12 +47,6 @@ void UpcomingPlaylist::initialize() ...@@ -47,12 +47,6 @@ void UpcomingPlaylist::initialize()
m_oldIterator = manager()->takeIterator(); m_oldIterator = manager()->takeIterator();
manager()->installIterator(new UpcomingSequenceIterator(this)); manager()->installIterator(new UpcomingSequenceIterator(this));
if(playingItem()) {
PlaylistItemList list;
list.append(playingItem());
createItems(list);
}
if(!m_oldIterator->current()) if(!m_oldIterator->current())
m_oldIterator->prepareToPlay(CollectionList::instance()); m_oldIterator->prepareToPlay(CollectionList::instance());
else else
...@@ -62,7 +56,7 @@ void UpcomingPlaylist::initialize() ...@@ -62,7 +56,7 @@ void UpcomingPlaylist::initialize()
// list instead of the first, so we'll need to move it after the list is // list instead of the first, so we'll need to move it after the list is
// initialized. Also, we should fill the list to our set number of items. // initialized. Also, we should fill the list to our set number of items.
bool needsAdjusting = !items().isEmpty(); bool needsAdjusting = playingItem() != 0;
if(needsAdjusting && action<KToggleAction>("loopPlaylist")->isChecked()) { if(needsAdjusting && action<KToggleAction>("loopPlaylist")->isChecked()) {
m_oldIterator->advance(); m_oldIterator->advance();
...@@ -81,7 +75,7 @@ void UpcomingPlaylist::appendItems(const PlaylistItemList &itemList) ...@@ -81,7 +75,7 @@ void UpcomingPlaylist::appendItems(const PlaylistItemList &itemList)
if(itemList.isEmpty()) if(itemList.isEmpty())
return; return;
createItems(itemList, static_cast<PlaylistItem *>(lastChild())); createItems(itemList, playingItem());
} }
void UpcomingPlaylist::removeIteratorOverride() void UpcomingPlaylist::removeIteratorOverride()
......
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