Skip to content
Snippets Groups Projects
Commit 347cfde5 authored by Max Klinger's avatar Max Klinger Committed by Yorhel
Browse files

change D semantics to clear the current directory instead of the selected one

parent 0a230cdd
No related branches found
No related tags found
No related merge requests found
...@@ -180,6 +180,10 @@ Delete the selected file or directory. An error message will be shown when the ...@@ -180,6 +180,10 @@ Delete the selected file or directory. An error message will be shown when the
contents of the directory do not match or do not exist anymore on the contents of the directory do not match or do not exist anymore on the
filesystem. filesystem.
=item D
Clears the current directory, deleting all of its content.
=item t =item t
Toggle dirs before files when sorting. Toggle dirs before files when sorting.
......
...@@ -435,13 +435,8 @@ int browse_key(int ch) { ...@@ -435,13 +435,8 @@ int browse_key(int ch) {
: "Folder clearing not available for imported directories."; : "Folder clearing not available for imported directories.";
break; break;
} }
if(sel == NULL || sel == dirlist_parent)
break;
if (!(sel->flags & FF_DIR)) {
message = "You can only clear folders";
}
info_show = 0; info_show = 0;
delete_init(sel, t, 1); delete_init(dirlist_par, NULL, 1);
break; break;
} }
......
...@@ -249,8 +249,11 @@ void delete_process() { ...@@ -249,8 +249,11 @@ void delete_process() {
delete_dir(root); delete_dir(root);
if(nextsel) if(nextsel)
nextsel->flags |= FF_BSEL; nextsel->flags |= FF_BSEL;
if (_clear)
browse_init(root);
else
browse_init(par); browse_init(par);
if(!_clear && nextsel) if(nextsel)
dirlist_top(-4); dirlist_top(-4);
} }
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
int page, start; int page, start;
#define KEYS 16 #define KEYS 17
char *keys[KEYS*2] = { char *keys[KEYS*2] = {
/*|----key----| |----------------description----------------|*/ /*|----key----| |----------------description----------------|*/
"up, k", "Move cursor up", "up, k", "Move cursor up",
...@@ -43,6 +43,7 @@ char *keys[KEYS*2] = { ...@@ -43,6 +43,7 @@ char *keys[KEYS*2] = {
"s", "Sort by size (ascending/descending)", "s", "Sort by size (ascending/descending)",
"C", "Sort by items (ascending/descending)", "C", "Sort by items (ascending/descending)",
"d", "Delete selected file or directory", "d", "Delete selected file or directory",
"D", "Clears the files in the current directory",
"t", "Toggle dirs before files when sorting", "t", "Toggle dirs before files when sorting",
"g", "Show percentage and/or graph", "g", "Show percentage and/or graph",
"a", "Toggle between apparent size and disk usage", "a", "Toggle between apparent size and disk usage",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment