Database: Disable delete hotkey unless audio file is selected

Fixes behavior where Rockbox would offer to
delete nonexistent directories.

Change-Id: I219da382b181372023b9408ac9a85189bffdcb74
This commit is contained in:
Christian Soffke 2023-04-02 16:53:04 +02:00
parent b31127db7d
commit 31d56d4a59

View file

@ -1890,6 +1890,13 @@ static bool hotkey_delete_item(void)
if (selected_file_attr & ATTR_VOLUME)
return false;
#endif
#ifdef HAVE_TAGCACHE
if (context == CONTEXT_ID3DB &&
(selected_file_attr & FILE_ATTR_MASK) != FILE_ATTR_AUDIO)
return false;
#endif
return delete_file_dir();
}