summaryrefslogtreecommitdiff
path: root/src/actions.cpp
diff options
context:
space:
mode:
authorAndrzej Rybczak <electricityispower@gmail.com>2014-10-04 17:17:23 +0200
committerAndrzej Rybczak <electricityispower@gmail.com>2014-10-04 17:17:23 +0200
commitaf3a6669154dc7b6b517907f2c3d769cf1504dec (patch)
treeed1d88eda229fa8b5daf7824073e61efdc38f3e2 /src/actions.cpp
parent9418451a31c7a27b0c777061605200e5d68112cb (diff)
playlist editor: make playlist deletion work
Diffstat (limited to 'src/actions.cpp')
-rw-r--r--src/actions.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/actions.cpp b/src/actions.cpp
index 649aebfe..17c51539 100644
--- a/src/actions.cpp
+++ b/src/actions.cpp
@@ -724,12 +724,13 @@ void DeleteBrowserItems::run()
bool DeleteStoredPlaylist::canBeRun() const
{
- return myScreen->isActiveWindow(myPlaylistEditor->Playlists)
- && myPlaylistEditor->Playlists.empty();
+ return myScreen->isActiveWindow(myPlaylistEditor->Playlists);
}
void DeleteStoredPlaylist::run()
{
+ if (myPlaylistEditor->Playlists.empty())
+ return;
boost::format question;
if (hasSelected(myPlaylistEditor->Playlists.begin(), myPlaylistEditor->Playlists.end()))
question = boost::format("Delete selected playlists?");
@@ -740,10 +741,8 @@ void DeleteStoredPlaylist::run()
if (yes)
{
auto list = getSelectedOrCurrent(myPlaylistEditor->Playlists.begin(), myPlaylistEditor->Playlists.end(), myPlaylistEditor->Playlists.currentI());
- Mpd.StartCommandsList();
for (auto it = list.begin(); it != list.end(); ++it)
Mpd.DeletePlaylist((*it)->value());
- Mpd.CommitCommandsList();
Statusbar::printf("%1% deleted", list.size() == 1 ? "Playlist" : "Playlists");
}
else