actions: fix playlist cropping when no item is selected

master
Andrzej Rybczak 12 years ago
parent 9238008033
commit c1c47bdfc4
  1. 6
      src/actions.cpp

@ -1734,7 +1734,11 @@ void CropMainPlaylist::run()
if (yes)
{
Statusbar::print("Cropping playlist...");
cropPlaylist(myPlaylist->main(), boost::bind(&MPD::Connection::Delete, _1, _2));
auto &w = myPlaylist->main();
// if no item is selected, select the current one
if (!w.empty() && !hasSelected(w.begin(), w.end()))
w.current().setSelected(true);
cropPlaylist(w, boost::bind(&MPD::Connection::Delete, _1, _2));
}
}

Loading…
Cancel
Save