Commit 575e1b6d authored by Scott Wheeler's avatar Scott Wheeler

Starting to look like the tree view again, but don't let the appearances

fool you, this really doesn't work yet.  It's slow and crashes a lot.

If I read on the Dot next week about how buggy and unprofessional the tree
view is I'm going to hurt someone making CVS packages.  ;-)

svn path=/trunk/kdemultimedia/juk/; revision=231293
parent 8d9583e4
......@@ -26,9 +26,9 @@ SearchPlaylist::SearchPlaylist(const PlaylistSearch &search, QWidget *parent, co
m_search(search),
m_dirty(true)
{
PlaylistList::Iterator it = search.playlists().begin();
for(; it != search.playlists().end(); ++it)
connect(*it, SIGNAL(signalChanged()), this, SLOT(slotSetDirty()));
// PlaylistList::Iterator it = search.playlists().begin();
// for(; it != search.playlists().end(); ++it)
// connect(*it, SIGNAL(signalChanged()), this, SLOT(slotSetDirty()));
}
////////////////////////////////////////////////////////////////////////////////
......
......@@ -23,6 +23,8 @@
#include "viewmode.h"
#include "playlistbox.h"
#include "searchplaylist.h"
#include "collectionlist.h"
////////////////////////////////////////////////////////////////////////////////
// ViewMode
......@@ -195,10 +197,11 @@ void TreeViewMode::setShown(bool show)
i = new PlaylistBox::Item(collectionItem, "cdimage", i18n("Artists"));
m_categories.insert("artists", i);
setupCategory(i, CollectionList::instance()->artists());
i = new PlaylistBox::Item(collectionItem, "cdimage", i18n("Albums"));
m_categories.insert("albums", i);
setupCategory(i, CollectionList::instance()->albums());
for(QDictIterator<PlaylistBox::Item> it(m_categories); it.current(); ++it)
it.current()->setSortedFirst(true);
......@@ -215,3 +218,22 @@ void TreeViewMode::setShown(bool show)
playlistBox()->setRootIsDecorated(show);
}
void TreeViewMode::setupCategory(PlaylistBox::Item *parent, const QStringList &members) const
{
CollectionList *collection = CollectionList::instance();
for(QStringList::ConstIterator it = members.begin(); it != members.end(); ++it) {
PlaylistSearch::ComponentList components;
components.append(PlaylistSearch::Component(*it));
PlaylistList playlists;
playlists.append(collection);
PlaylistSearch s(playlists, components, PlaylistSearch::MatchAny, false);
SearchPlaylist *p = new SearchPlaylist(s, static_cast<QWidget *>(collection->parent()), *it);
new PlaylistBox::Item(parent, "midi", *it, p);
}
}
......@@ -81,6 +81,8 @@ public:
virtual void setShown(bool shown);
private:
void setupCategory(PlaylistBox::Item *parent, const QStringList &members) const;
QDict<PlaylistBox::Item> m_categories;
};
......
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