Commit 122968e3 authored by Scott Wheeler's avatar Scott Wheeler

Ugh, so...tired...but...wanted...to..get...working.

Ok -- yeah -- this finally restores the "Play Next" semantics by continuing
from the end of the play queue in the playlist where the last item came from
when the play queue runs out.  This fits nicely with the stuff to show the
playing indicator in both lists.

svn path=/trunk/kdemultimedia/juk/; revision=362179
parent c8f0a758
......@@ -157,11 +157,36 @@ void UpcomingPlaylist::fillList()
void UpcomingPlaylist::addNewItem()
{
m_oldIterator->advance();
PlaylistItem *last = static_cast<PlaylistItem *>(lastChild());
if(m_oldIterator->current())
createItem(m_oldIterator->current()->file(), last);
if(firstChild()) {
Playlist *source = m_playlistIndex[firstChild()];
if(!source)
return;
CollectionListItem *base = firstChild()->collectionItem();
PlaylistItem *target = 0;
for(QListViewItemIterator it(source); it.current(); ++it) {
if(static_cast<PlaylistItem *>(it.current())->collectionItem() == base) {
target = static_cast<PlaylistItem *>(it.current());
break;
}
}
if(!target)
return;
m_oldIterator->setCurrent(target);
m_oldIterator->advance();
}
if(m_oldIterator->current()) {
last = createItem(m_oldIterator->current(), last);
m_playlistIndex.insert(last, m_oldIterator->current()->playlist());
dataChanged();
slotWeightDirty();
}
}
inline TrackSequenceManager *UpcomingPlaylist::manager() const
......@@ -185,11 +210,10 @@ UpcomingPlaylist::UpcomingSequenceIterator::~UpcomingSequenceIterator()
void UpcomingPlaylist::UpcomingSequenceIterator::advance()
{
bool loop = action("loopPlaylist") && action<KToggleAction>("loopPlaylist")->isChecked();
PlaylistItem *item = m_playlist->firstChild();
if(item) {
if(loop)
if(!item->nextSibling())
m_playlist->addNewItem();
m_playlist->setPlaying(0);
......
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