From 047dabd41ab6f1c131ef04ecae0e20150251ab00 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Tue, 17 Mar 2009 18:25:44 +0100 Subject: [PATCH] limit clear and crop function to playlist/playlist editor this will minimize the risk of unwanted clearing of playlist e.g. by pressing 'c' key accidentaly in other screen than playlist/playlist editor. --- src/ncmpcpp.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ncmpcpp.cpp b/src/ncmpcpp.cpp index cbafe914..dd38088c 100644 --- a/src/ncmpcpp.cpp +++ b/src/ncmpcpp.cpp @@ -1463,7 +1463,7 @@ int main(int argc, char *argv[]) myPlaylist->EnableHighlighting(); FreeSongList(result); } - else if (Keypressed(input, Key.Crop)) + else if (Keypressed(input, Key.Crop) && myScreen == myPlaylist) { CHECK_PLAYLIST_FOR_FILTERING; if (myPlaylist->Main()->hasSelected()) @@ -1501,6 +1501,8 @@ int main(int argc, char *argv[]) } else if (Keypressed(input, Key.Clear)) { + if (myScreen != myPlaylist && myScreen != myPlaylistEditor) + continue; if (myPlaylist->Main()->isFiltered()) { ShowMessage("Deleting filtered items...");