View Issue Details

IDProjectCategoryView StatusLast Update
0038091LazarusLCLpublic2020-11-17 14:06
ReporterdevEric69 Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Summary0038091: Request for modification of FileUtil.pas (TListFileSearcher.DoFileFound and TListDirectoriesSearcher.DoDirectoryFound)
DescriptionWell, when TListFileSearcher.DoFileFound or TListDirectoriesSearcher.DoDirectoryFound "matches", I \ we know that the current field named FileName that has passed the filtering of the search mask (glob regex of the FileName), and the filtering of the possible attributes of the file (hidden or not, system or not, ...). The field named FileName is therefore a file or a directory that interests me \ us, and that I \ we add to the FList. But, I find that the event associated with each correspondence (a file or a directory), missed to be pulled to take advantage of the inheritance. So, I propose to add 2 lines (Cf. // ++):

procedure TListFileSearcher.DoFileFound;
begin
  inherited DoFileFound; // ++
  FList.Add(FileName);
end;

procedure TListDirectoriesSearcher.DoDirectoryFound;
begin
  inherited DoDirectoryFound; // ++
  FDirectoriesList.Add(FileName);
end;


TagsNo tags attached.
Fixed in Revision
LazTarget
Widgetset
Attached Files

Activities

wp

2020-11-17 11:51

developer   ~0126997

I think it is more logical when the "inherited" is called AFTER the *List.Add calls because then the new entry is already listed when the event fires -- an event handler, for example, counting the found items on the fly would see the correct number of entries this way.

devEric69

2020-11-17 14:06

reporter   ~0126998

Indeed, the event can rather be read as "found" ...in the list, TListFileSearcher or TListDirectoriesSearcher (therefore, already stored inside the list).

Issue History

Date Modified Username Field Change
2020-11-17 10:35 devEric69 New Issue
2020-11-17 11:07 Michael Van Canneyt Project FPC => Lazarus
2020-11-17 11:51 wp Note Added: 0126997
2020-11-17 14:06 devEric69 Note Added: 0126998