Commit c8f0a758 authored by Scott Wheeler's avatar Scott Wheeler

Ok, make things almost sane with the play queue. It still doesn't continue

where it left off, but you see -- we build to that.

svn path=/trunk/kdemultimedia/juk/; revision=362174
parent fa5b8b2d
......@@ -485,6 +485,9 @@ QObject *PlaylistCollection::object() const
Playlist *PlaylistCollection::currentPlaylist() const
{
if(m_upcomingPlaylist)
return m_upcomingPlaylist;
if(Playlist::playingItem())
return Playlist::playingItem()->playlist();
else
......
......@@ -111,6 +111,11 @@ void UpcomingPlaylist::clearItem(PlaylistItem *item, bool emitChanged)
Playlist::clearItem(item, emitChanged);
}
QMap< PlaylistItem *, QGuardedPtr<Playlist> > &UpcomingPlaylist::playlistIndex()
{
return m_playlistIndex;
}
void UpcomingPlaylist::removeIteratorOverride()
{
if(!m_oldIterator)
......@@ -228,9 +233,10 @@ void UpcomingPlaylist::UpcomingSequenceIterator::setCurrent(PlaylistItem *curren
Playlist *p = currentItem->playlist();
if(p != m_playlist) {
PlaylistItemList list;
list.append(currentItem);
m_playlist->createItems(list);
PlaylistItem *i = m_playlist->createItem(currentItem, (PlaylistItem *) 0);
m_playlist->playlistIndex().insert(i, p);
m_playlist->dataChanged();
m_playlist->slotWeightDirty();
}
else {
......
......@@ -82,7 +82,15 @@ public:
*/
void appendItems(const PlaylistItemList &itemList);
/**
* Reimplemented to set the playing item in both the source playlist
* and the upcoming playlist.
*/
virtual void playNext();
/**
* Reimplemented to remove the item from the Playlist index.
*/
virtual void clearItem(PlaylistItem *item, bool emitChanged = true);
/**
......@@ -90,7 +98,7 @@ public:
* playlist that they came from. This is used to remap the currently
* playing item to the source playlist.
*/
QMap< PlaylistItem *, QGuardedPtr<Playlist> > &playlistIndex() const;
QMap< PlaylistItem *, QGuardedPtr<Playlist> > &playlistIndex();
private:
......
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