Commit 788f18da authored by Scott Wheeler's avatar Scott Wheeler

Don't refresh the search so often (i.e. every time that a column is shown

or hidden), notably when we're going to update the search before we show
the list anyway.  This speeds up switching between lists.

svn path=/trunk/kdemultimedia/juk/; revision=250423
parent 4a81ce71
......@@ -138,9 +138,9 @@ void Playlist::SharedSettings::apply(Playlist *l) const
for(uint i = 0; i < m_columnsVisible.size(); i++) {
if(m_columnsVisible[i] && !l->isColumnVisible(i + offset))
l->showColumn(i + offset);
l->showColumn(i + offset, false);
else if(!m_columnsVisible[i] && l->isColumnVisible(i + offset))
l->hideColumn(i + offset);
l->hideColumn(i + offset, false);
}
l->updateLeftColumn();
......@@ -777,7 +777,7 @@ void Playlist::createItems(const PlaylistItemList &siblings)
createItems<CollectionListItem, PlaylistItem, PlaylistItem>(siblings);
}
void Playlist::hideColumn(int c)
void Playlist::hideColumn(int c, bool emitChanged)
{
m_headerMenu->setItemChecked(c, false);
......@@ -799,12 +799,13 @@ void Playlist::hideColumn(int c)
triggerUpdate();
if(this != CollectionList::instance())
CollectionList::instance()->hideColumn(c);
CollectionList::instance()->hideColumn(c, false);
CollectionList::instance()->emitVisibleColumnsChanged();
if(emitChanged)
CollectionList::instance()->emitVisibleColumnsChanged();
}
void Playlist::showColumn(int c)
void Playlist::showColumn(int c, bool emitChanged)
{
m_headerMenu->setItemChecked(c, true);
......@@ -828,9 +829,10 @@ void Playlist::showColumn(int c)
triggerUpdate();
if(this != CollectionList::instance())
CollectionList::instance()->showColumn(c);
CollectionList::instance()->showColumn(c, false);
CollectionList::instance()->emitVisibleColumnsChanged();
if(emitChanged)
CollectionList::instance()->emitVisibleColumnsChanged();
}
bool Playlist::isColumnVisible(int c) const
......
......@@ -164,8 +164,19 @@ public:
*/
void setFileName(const QString &n) { m_fileName = n; }
void hideColumn(int c);
void showColumn(int c);
/**
* Hides column \a c. If \a emitChanged is true then a signal that the
* visible columns have changed will be emitted and things like the search
* will be udated.
*/
void hideColumn(int c, bool emitChanged = true);
/**
* Shows column \a c. If \a emitChanged is true then a signal that the
* visible columns have changed will be emitted and things like the search
* will be udated.
*/
void showColumn(int c, bool emitChanged = true);
bool isColumnVisible(int c) const;
/**
......
......@@ -60,7 +60,7 @@ PlaylistSplitter::PlaylistSplitter(QWidget *parent, const char *name) :
m_restore = true;
#endif
m_dirWatch = new KDirWatch();
m_dirWatch = new KDirWatch;
setupLayout();
readConfig();
......@@ -668,6 +668,9 @@ 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()
......@@ -810,7 +813,9 @@ void PlaylistSplitter::slotChangePlaylist(const PlaylistList &l)
emit signalPlaylistChanged();
return;
}
if(l.count() == 1 && l.first() == visiblePlaylist())
return;
// Save the current dynamic list so that we can delete it when we're done
// showing the next list. The two situations are that we're either showing
// an existing, non-dynamic list or that we're creating a dynamic list; in
......@@ -915,7 +920,6 @@ void PlaylistSplitter::slotShowSearchResults()
void PlaylistSplitter::slotVisibleColumnsChanged()
{
m_searchWidget->updateColumns();
// if(m_searchWidget->searchedColumns(0).count() > 1)
slotShowSearchResults();
}
......
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