Commit a266e338 authored by Scott Wheeler's avatar Scott Wheeler

My most hated JuK bug in 3.4 (so this will be backported shortly) -- when

switching playlists the setSearch() call was being called before visiblePlaylist()
reported the new playlist, so it was basically clearing the search term for the
playlist that was about to go to the background.  This meant that when you switch
back to it your search is cleared.

svn path=/trunk/KDE/kdemultimedia/juk/; revision=422080
parent a3558db8
......@@ -659,6 +659,8 @@ void Playlist::setItemsVisible(const PlaylistItemList &items, bool visible) // s
void Playlist::setSearch(const PlaylistSearch &s)
{
kdDebug(65432) << k_funcinfo << name() << " - " << s.components().first().query() << endl;
m_search = s;
if(!m_searchEnabled)
......
......@@ -36,6 +36,7 @@ using namespace ActionCollection;
PlaylistSplitter::PlaylistSplitter(QWidget *parent, const char *name) :
QSplitter(Qt::Horizontal, parent, name),
m_newVisible(0),
m_playlistBox(0),
m_searchWidget(0),
m_playlistStack(0),
......@@ -100,6 +101,11 @@ void PlaylistSplitter::slotFocusCurrentPlaylist()
// private members
////////////////////////////////////////////////////////////////////////////////
Playlist *PlaylistSplitter::visiblePlaylist() const
{
return m_newVisible ? m_newVisible : m_playlistBox->visiblePlaylist();
}
void PlaylistSplitter::setupActions()
{
KToggleAction *showSearch =
......@@ -210,8 +216,12 @@ void PlaylistSplitter::slotPlaylistChanged(QWidget *w)
{
Playlist *p = dynamic_cast<Playlist *>(w);
if(p)
m_searchWidget->setSearch(p->search());
if(!p)
return;
m_newVisible = p;
m_searchWidget->setSearch(p->search());
m_newVisible = 0;
}
#include "playlistsplitter.moc"
......@@ -58,7 +58,7 @@ private:
* This returns a pointer to the first item in the playlist on the top
* of the QWidgetStack of playlists.
*/
Playlist *visiblePlaylist() const { return m_playlistBox->visiblePlaylist(); }
Playlist *visiblePlaylist() const;
void setupActions();
void setupLayout();
......@@ -76,6 +76,7 @@ private slots:
void slotPlaylistChanged(QWidget *w);
private:
Playlist *m_newVisible;
PlaylistBox *m_playlistBox;
SearchWidget *m_searchWidget;
QWidgetStack *m_playlistStack;
......
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