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:
1 parent
1633a1e76c
commit
fde535d7c7
2 files changed
+123
-89
No files matched your search
@@ -637,6 +637,8 @@ begin
|
|||||||
ctx := PFBCollectCtx(ud);
|
ctx := PFBCollectCtx(ud);
|
||||||
obj := PVFSObject(data);
|
obj := PVFSObject(data);
|
||||||
if (ctx = nil) or (obj = nil) then exit;
|
if (ctx = nil) or (obj = nil) then exit;
|
||||||
|
{ Always hide '.' and '..' entries }
|
||||||
|
if stringEquals(key, '.') or stringEquals(key, '..') then exit;
|
||||||
case obj^.ObjectType of
|
case obj^.ObjectType of
|
||||||
otVDIRECTORY, otDRIVE, otDIRECTORY, otMOUNT, otSYMLINK:
|
otVDIRECTORY, otDRIVE, otDIRECTORY, otMOUNT, otSYMLINK:
|
||||||
if ctx^.dir_count < ENTRY_MAX then begin
|
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_DIRECTORY, 32, state, @fb_newfolder_cb);
|
||||||
makeToolBtn(toolbar, SYM_FILE, 32, state, @fb_newfile_cb);
|
makeToolBtn(toolbar, SYM_FILE, 32, state, @fb_newfile_cb);
|
||||||
makeToolBtn(toolbar, SYM_EDIT, 32, state, @fb_rename_cb);
|
makeToolBtn(toolbar, SYM_EDIT, 32, state, @fb_rename_cb);
|
||||||
|
makeToolBtn(toolbar, SYM_TRASH, 32, state, @fb_delete_cb);
|
||||||
|
|
||||||
{ Filter input }
|
{ Filter input }
|
||||||
state^.filter_ta := lv_textarea_create(toolbar);
|
state^.filter_ta := lv_textarea_create(toolbar);
|
||||||
|
|||||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user