summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Soffke <christian.soffke@gmail.com>2023-04-02 16:53:04 +0200
committerChristian Soffke <christian.soffke@gmail.com>2023-04-05 07:16:18 -0400
commit31d56d4a59054f4e32a99561fd41abc1d3516eed (patch)
tree06ee06e0647efb9f002a5c386090f62a4a3f4e3d
parentb31127db7d169153ac11ab71d8c202e7b95365e4 (diff)
downloadrockbox-31d56d4a59.tar.gz
rockbox-31d56d4a59.zip
Database: Disable delete hotkey unless audio file is selected
Fixes behavior where Rockbox would offer to delete nonexistent directories. Change-Id: I219da382b181372023b9408ac9a85189bffdcb74
-rw-r--r--apps/onplay.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/onplay.c b/apps/onplay.c
index 96c2ddd4e3..4ef79fc220 100644
--- a/apps/onplay.c
+++ b/apps/onplay.c
@@ -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();
}