FIX: the issue that original file list and new file list competed for updates when changing folders in FileView

it's because the original file list was not cleared, and there was another update before the new file list was loaded
This commit is contained in:
rich2014 2026-06-07 18:35:10 +08:00
commit 76e7585c30

View file

@ -386,6 +386,7 @@ type
destructor Destroy; override;
procedure Clear;
procedure clearFilesOnly;
function Clone({%H-}NewParent: TWinControl): TFileView; virtual;
procedure CloneTo(AFileView: TFileView); virtual;
@ -1041,15 +1042,22 @@ begin
HashFileList;
end;
procedure TFileView.clearFilesOnly;
begin
if Assigned(FFiles) then
FFiles.Clear;
if Assigned(FAllDisplayFiles) then
FAllDisplayFiles.Clear;
HashFileList;
end;
procedure TFileView.ClearFiles;
begin
if Assigned(FAllDisplayFiles) then
begin
ClearRecentlyUpdatedFiles;
ClearPendingFilesChanges;
FFiles.Clear;
FAllDisplayFiles.Clear; // Clear references to files from the source.
HashFileList;
clearFilesOnly;
Notify([fvnDisplayFileListChanged]);
end;
end;
@ -3039,6 +3047,8 @@ begin
EnableWatcher(False);
clearFilesOnly;
FHistory.Add(aFileSource, aPath);
AfterChangePath;
@ -3095,6 +3105,8 @@ begin
EnableWatcher(False);
clearFilesOnly;
FHistory.DeleteFromCurrentFileSource;
AfterChangePath;
@ -3574,6 +3586,8 @@ begin
FileSource.RemoveEventListener(@FileSourceEventListener);
EnableWatcher(False);
clearFilesOnly;
FHistory.SetIndexes(aFileSourceIndex, aPathIndex);
if Assigned(FileSource) and IsNewFileSource then