Commit ebab3143 authored by Scott Wheeler's avatar Scott Wheeler

Save and restore all items in the playlists -- not just the ones that match

the search.  I had to make a couple of things non-const here since Qt doesn't
provide a const iterator for listviews.

svn path=/trunk/kdemultimedia/juk/; revision=250425
parent 788f18da
......@@ -315,12 +315,12 @@ void Playlist::clearItems(const PlaylistItemList &items)
emit signalCountChanged(this);
}
QStringList Playlist::files() const
QStringList Playlist::files()
{
QStringList list;
PlaylistItem *i = static_cast<PlaylistItem *>(firstChild());
for(; i; i = static_cast<PlaylistItem *>(i->itemBelow()))
list.append(i->absFilePath());
for(QListViewItemIterator it(this); it.current(); ++it)
list.append(static_cast<PlaylistItem *>(*it)->absFilePath());
return list;
}
......@@ -1408,7 +1408,7 @@ void Playlist::slotInlineCompletionModeChanged(KGlobalSettings::Completion mode)
// helper functions
////////////////////////////////////////////////////////////////////////////////
QDataStream &operator<<(QDataStream &s, const Playlist &p)
QDataStream &operator<<(QDataStream &s, Playlist &p)
{
s << p.name();
s << p.fileName();
......
......@@ -100,7 +100,7 @@ public:
/**
* All of the (media) files in the list.
*/
QStringList files() const;
QStringList files();
/**
* Returns a list of all of the \e visible items in the playlist.
......@@ -607,7 +607,7 @@ private:
static PlaylistItem *m_playingItem;
};
QDataStream &operator<<(QDataStream &s, const Playlist &p);
QDataStream &operator<<(QDataStream &s, Playlist &p);
QDataStream &operator>>(QDataStream &s, Playlist &p);
// template method implementations
......
......@@ -668,9 +668,6 @@ void PlaylistSplitter::redisplaySearch()
Playlist::setItemsVisible(visiblePlaylist()->search().matchedItems(), true);
Playlist::setItemsVisible(visiblePlaylist()->search().unmatchedItems(), false);
}
// kdDebug(65432) << k_funcinfo << "files().count() == "
// << visiblePlaylist()->files().count() << endl;
}
void PlaylistSplitter::readPlaylists()
......
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