logo       

[Amarok] Clear the playlist filter (if active, do not clear: msg#13013

kde-commits

Subject: [Amarok] Clear the playlist filter (if active, do not clear

commit acc6fd2522d807746c7aef51e76005bc64c9158f
Author: Nikolaj Hald Nielsen <nhnFreespirit@xxxxxxxxx>
AuthorDate: Fri Jul 31 20:51:48 2009 +0200
Commit: Nikolaj Hald Nielsen <nhnFreespirit@xxxxxxxxx>
CommitDate: Fri Jul 31 20:51:48 2009 +0200

Clear the playlist filter (if active, do not clear if we are searching and
not filtering) when using the "replace playlist" action.
Thanks to John Atkinson <john@xxxxxxxxxxxxxxx> for the patch! :-)
BUG: 200709

diff --git a/src/playlist/PlaylistController.cpp
b/src/playlist/PlaylistController.cpp
index 92f57b0..63c6f32 100644
--- a/src/playlist/PlaylistController.cpp
+++ b/src/playlist/PlaylistController.cpp
@@ -99,6 +99,8 @@ Playlist::Controller::insertOptioned( Meta::TrackList list,
int options )
int firstItemAdded = -1;
if ( options & Replace )
{
+ emit replacingPlaylist();
+
m_undoStack->beginMacro( "Replace playlist" ); // TODO: does this need
to be internationalized?
clear();
insertionHelper( -1, list );
diff --git a/src/playlist/PlaylistController.h
b/src/playlist/PlaylistController.h
index bfc6cd3..6349c00 100644
--- a/src/playlist/PlaylistController.h
+++ b/src/playlist/PlaylistController.h
@@ -97,6 +97,8 @@ signals:
void canRedoChanged( bool );
void canUndoChanged( bool );

+ void replacingPlaylist();
+
private slots:
void newResultReady( const QString&, const Meta::TrackList& );
void queryDone();
diff --git a/src/playlist/PlaylistWidget.cpp b/src/playlist/PlaylistWidget.cpp
index dadf567..c87ed73 100644
--- a/src/playlist/PlaylistWidget.cpp
+++ b/src/playlist/PlaylistWidget.cpp
@@ -154,6 +154,11 @@ Playlist::Widget::Widget( QWidget* parent )
} //END Playlist Toolbar

setFrameShape( QFrame::NoFrame );
+
+
+ // If it is active, clear the search filter before replacing the playlist.
Fixes Bug #200709.
+ connect( The::playlistController(), SIGNAL( replacingPlaylist() ), this,
SLOT( clearFilterIfActive() ) );
+
}

QSize
@@ -183,3 +188,14 @@ Playlist::Widget::showDynamicHint( bool enabled )

}

+void
+Playlist::Widget::clearFilterIfActive()
+{
+ DEBUG_BLOCK
+ KConfigGroup config = Amarok::config( "Playlist Search" );
+ bool filterActive = config.readEntry( "ShowOnlyMatches", true );
+
+ if( filterActive )
+ m_searchWidget->slotFilterClear();
+
+}
diff --git a/src/playlist/PlaylistWidget.h b/src/playlist/PlaylistWidget.h
index 42318f7..2f8549e 100644
--- a/src/playlist/PlaylistWidget.h
+++ b/src/playlist/PlaylistWidget.h
@@ -42,6 +42,7 @@ namespace Playlist

public slots:
void showDynamicHint( bool enabled );
+ void clearFilterIfActive();

protected:
QSize sizeHint() const;


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | Mail Home | sitemap | FAQ | advertise