Commit 7cdee8b4 authored by Scott Wheeler's avatar Scott Wheeler

A couple of small clean ups and added some processEvents hackery...

svn path=/trunk/kdemultimedia/juk/; revision=231704
parent ec588013
......@@ -280,7 +280,8 @@ void Playlist::clearItems(const PlaylistItemList &items)
QStringList Playlist::files() const
{
QStringList list;
for(PlaylistItem *i = static_cast<PlaylistItem *>(firstChild()); i; i = static_cast<PlaylistItem *>(i->itemBelow()))
PlaylistItem *i = static_cast<PlaylistItem *>(firstChild());
for(; i; i = static_cast<PlaylistItem *>(i->itemBelow()))
list.append(i->absFilePath());
return list;
......@@ -298,13 +299,16 @@ PlaylistItemList Playlist::items()
PlaylistItemList Playlist::visibleItems() const
{
PlaylistItemList list;
for(PlaylistItem *i = static_cast<PlaylistItem *>(firstChild()); i; i = static_cast<PlaylistItem *>(i->itemBelow())) {
//This check should be removed at some point since those items should all be already visible
//at the time of writing there's a bug that leaves some invisible items in the list
PlaylistItem *i = static_cast<PlaylistItem *>(firstChild());
for(; i; i = static_cast<PlaylistItem *>(i->itemBelow())) {
// This check should be removed at some point since those items should
// all be already visible at the time of writing there's a bug that
// leaves some invisible items in the list
if(i->isVisible())
list.append(i);
else
kdDebug(65432)<<"File shouldn't be in the list"<< i->fileName()<<endl;
kdDebug(65432) << "File shouldn't be in the list" << i->fileName() << endl;
}
return list;
......@@ -736,6 +740,8 @@ QString Playlist::resolveSymLinks(const QFileInfo &file) // static
void Playlist::polish()
{
KListView::polish();
if(m_polished)
return;
......@@ -778,11 +784,11 @@ void Playlist::polish()
m_headerMenu->insertTitle(i18n("Show"));
m_headerMenu->setCheckable(true);
for(int i =0; i < header()->count(); ++i) {
for(int i = 0; i < header()->count(); ++i) {
m_headerMenu->insertItem(header()->label(i), i);
m_headerMenu->setItemChecked(i, true);
adjustColumn(i);
}
connect(m_headerMenu, SIGNAL(activated(int)), this, SLOT(slotToggleColumnVisible(int)));
......
......@@ -223,6 +223,8 @@ void TreeViewMode::setupCategory(PlaylistBox::Item *parent, const QStringList &m
{
CollectionList *collection = CollectionList::instance();
KApplication::setOverrideCursor(Qt::waitCursor);
for(QStringList::ConstIterator it = members.begin(); it != members.end(); ++it) {
PlaylistSearch::ComponentList components;
......@@ -235,5 +237,11 @@ void TreeViewMode::setupCategory(PlaylistBox::Item *parent, const QStringList &m
SearchPlaylist *p = new SearchPlaylist(s, static_cast<QWidget *>(collection->parent()), *it);
new PlaylistBox::Item(parent, "midi", *it, p);
static int i = 0;
if(++i % 5 == 0)
kapp->processEvents();
}
KApplication::restoreOverrideCursor();
}
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