actions: add missing flag restriction for physical deletion

This commit is contained in:
Andrzej Rybczak
2014-08-27 02:01:44 +02:00
parent 1fc2ce2d3c
commit 8d1b10fb3e
6 changed files with 25 additions and 1 deletions

View File

@@ -643,9 +643,19 @@ void DeletePlaylistItems::run()
bool DeleteBrowserItems::canBeRun() const
{
auto check_if_deletion_allowed = []() {
if (Config.allow_for_physical_item_deletion)
return true;
else
{
Statusbar::msg("Flag 'allow_for_physical_item_deletion' needs to be enabled in configuration file");
return false;
}
};
return myScreen == myBrowser
&& !myBrowser->main().empty()
&& isMPDMusicDirSet();
&& isMPDMusicDirSet()
&& check_if_deletion_allowed();
}
void DeleteBrowserItems::run()