feat(filebrowser): add delete button to toolbar, fix FAT32 delete/rename with raw sector scanning
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

- Add SYM_TRASH toolbar button wired to fb_delete_cb (was missing entirely)
- Filter '.' and '..' entries in fb_collect_cb so they never appear
- Rewrite deleteFile/deleteDir/renameFile to use raw sector scanning
  instead of getDirEntries linked-list indices (fixes  gap mismatch)
- Handle root directory correctly (use bootRecord^.rootCluster instead
  of assuming entry 0 is '.')
This commit is contained in:
2026-03-11 19:41:51 +00:00
parent 671c144ad5
commit ee7dcd107b
2 changed files with 203 additions and 169 deletions
+3
View File
@@ -637,6 +637,8 @@ begin
ctx := PFBCollectCtx(ud);
obj := PVFSObject(data);
if (ctx = nil) or (obj = nil) then exit;
{ Always hide '.' and '..' entries }
if stringEquals(key, '.') or stringEquals(key, '..') then exit;
case obj^.ObjectType of
otVDIRECTORY, otDRIVE, otDIRECTORY, otMOUNT, otSYMLINK:
if ctx^.dir_count < ENTRY_MAX then begin
@@ -3075,6 +3077,7 @@ begin
makeToolBtn(toolbar, SYM_DIRECTORY, 32, state, @fb_newfolder_cb);
makeToolBtn(toolbar, SYM_FILE, 32, state, @fb_newfile_cb);
makeToolBtn(toolbar, SYM_EDIT, 32, state, @fb_rename_cb);
makeToolBtn(toolbar, SYM_TRASH, 32, state, @fb_delete_cb);
{ Filter input }
state^.filter_ta := lv_textarea_create(toolbar);
File diff suppressed because it is too large Load Diff