feat(filebrowser): add delete button to toolbar, fix FAT32 delete/rename with raw sector scanning
- 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:
@@ -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
Reference in New Issue
Block a user