Commit 0b79103c authored by Scott Wheeler's avatar Scott Wheeler

Remove the requirement of having two of a particular artist or album for it

to show up in the tree view.

CCMAIL:76211-done@bugs.kde.org

svn path=/trunk/kdemultimedia/juk/; revision=303466
parent 796c52c3
......@@ -124,7 +124,6 @@ void CollectionList::slotRefreshItem(const QString &file)
CollectionList::CollectionList(QWidget *parent) :
Playlist(parent, i18n("Collection List")),
m_itemsDict(5003),
m_viewModeItems(m_uniqueSetCount, SortedStringList()),
m_uniqueSets(m_uniqueSetCount, SortedStringList()),
m_uniqueSetLast(m_uniqueSetCount, QString::null)
{
......@@ -162,9 +161,7 @@ void CollectionList::addUnique(UniqueSetType t, const QString &value)
if(value.isEmpty())
return;
if(value == m_uniqueSetLast[t] || m_uniqueSets[t].insert(value))
m_viewModeItems[t].insert(value);
else {
if(value != m_uniqueSetLast[t] && !m_uniqueSets[t].insert(value)) {
m_uniqueSetLast[t] = value;
emit signalCollectionChanged();
}
......
......@@ -62,13 +62,6 @@ public:
*/
QStringList uniqueSet(UniqueSetType t) const { return m_uniqueSets[t].values(); }
/**
* This is similar to uniqueSet() but in this case only returns values for
* which there are two or more occurances in the collection list. This is
* useful when grouping items.
*/
QStringList viewModeItems(UniqueSetType t) const { return m_viewModeItems[t].values(); }
CollectionListItem *lookup(const QString &file) { return m_itemsDict.find(file); }
virtual PlaylistItem *createItem(const FileHandle &file,
......@@ -127,7 +120,6 @@ private:
static CollectionList *m_list;
QDict<CollectionListItem> m_itemsDict;
KDirWatch *m_dirWatch;
QValueVector<SortedStringList> m_viewModeItems;
QValueVector<SortedStringList> m_uniqueSets;
QValueVector<QString> m_uniqueSetLast;
};
......
......@@ -302,17 +302,17 @@ void TreeViewMode::slotSetupCategories()
i = new PlaylistBox::Item(collectionItem, "cdimage", i18n("Artists"));
m_searchCategories.insert("artists", i);
setupCategory("artists", CollectionList::instance()->viewModeItems(CollectionList::Artists),
setupCategory("artists", CollectionList::instance()->uniqueSet(CollectionList::Artists),
PlaylistItem::ArtistColumn, false);
i = new PlaylistBox::Item(collectionItem, "cdimage", i18n("Albums"));
m_searchCategories.insert("albums", i);
setupCategory("albums", CollectionList::instance()->viewModeItems(CollectionList::Albums),
setupCategory("albums", CollectionList::instance()->uniqueSet(CollectionList::Albums),
PlaylistItem::AlbumColumn);
i = new PlaylistBox::Item(collectionItem, "cdimage", i18n("Genres"));
m_searchCategories.insert("genres", i);
setupCategory("genres", CollectionList::instance()->viewModeItems(CollectionList::Genres),
setupCategory("genres", CollectionList::instance()->uniqueSet(CollectionList::Genres),
PlaylistItem::GenreColumn);
for(QDictIterator<PlaylistBox::Item> it(m_searchCategories); it.current(); ++it)
......
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