LCL: Restore a class procedure TCustomShellTreeView.GetFilesInDir. Rename a helper procedure to avoid name clash.

(cherry picked from commit ef8b5603be)
This commit is contained in:
Juha 2023-12-02 14:49:33 +02:00 committed by Maxim Ganetsky
parent 25e47282b1
commit 094bdc589d

View File

@ -119,8 +119,11 @@ type
destructor Destroy; override;
{ Methods specific to Lazarus - useful for other classes }
class function GetBasePath: string;
function GetRootPath: string;
class function GetBasePath: string;
function GetRootPath: string;
class procedure GetFilesInDir(const ABaseDir: string; AMask: string;
AObjectTypes: TObjectTypes; AResult: TStrings; AFileSortType: TFileSortType = fstNone;
ACaseSensitivity: TMaskCaseSensitivity = mcsPlatformDefault);
{ Other methods specific to Lazarus }
function GetPathFromNode(ANode: TTreeNode): string;
procedure PopulateWithBaseFiles;
@ -472,7 +475,7 @@ end;
{ TFileItemAVLTree
Specialized TAVLTree descendant for sorting the TFileItems found by the
helper function GetFilesInDir such that a user-friendly compare function
helper function GetFilesInDirectory such that a user-friendly compare function
can be applied. }
type
@ -820,7 +823,7 @@ end;
AMask may contain multiple file masks separated by ;
}
procedure GetFilesInDir(const ABaseDir: string; AMask: string;
procedure GetFilesInDirectory(const ABaseDir: string; AMask: string;
AObjectTypes: TObjectTypes; AResult: TStrings; AFileSortType: TFileSortType;
ACaseSensitivity: TMaskCaseSensitivity = mcsPlatformDefault;
ASortCompare: TFileItemCompareEvent = nil);
@ -981,6 +984,14 @@ begin
Result := IncludeTrailingPathDelimiter(Result);
end;
class procedure TCustomShellTreeView.GetFilesInDir(const ABaseDir: string;
AMask: string; AObjectTypes: TObjectTypes; AResult: TStrings;
AFileSortType: TFileSortType; ACaseSensitivity: TMaskCaseSensitivity);
begin
GetFilesInDirectory(ABaseDir, AMask, AObjectTypes, AResult,
AFileSortType, ACaseSensitivity);
end;
function TCustomShellTreeView.NodeHasChildren(Node: TTreeNode): Boolean;
function HasSubDir(Const ADir: String): Boolean;
@ -1046,7 +1057,8 @@ begin
Items.BeginUpdate;
try
Files.OwnsObjects := True;
GetFilesInDir(ANodePath, AllFilesMask, FObjectTypes, Files, FFileSortType, mcsPlatformDefault, FOnSortCompare);
GetFilesInDirectory(ANodePath, AllFilesMask, FObjectTypes, Files,
FFileSortType, mcsPlatformDefault, FOnSortCompare);
Result := Files.Count > 0;
for i := 0 to Files.Count - 1 do
@ -1161,10 +1173,10 @@ begin
FOnAddItem(Self, ABasePath, AFileInfo, CanAdd);
end;
function TCustomShellTreeView.DrawBuiltinIcon(ANode: TTreeNode; ARect: TRect): TSize;
function TCustomShellTreeView.DrawBuiltInIcon(ANode: TTreeNode; ARect: TRect): TSize;
begin
if FUseBuiltinIcons then
Result := TWSCustomShellTreeViewClass(WidgetSetClass).DrawBuiltinIcon(Self, ANode, ARect)
Result := TWSCustomShellTreeViewClass(WidgetSetClass).DrawBuiltInIcon(Self, ANode, ARect)
else
Result := inherited;
end;
@ -1685,7 +1697,8 @@ begin
Files := TStringList.Create;
try
Files.OwnsObjects := True;
GetFilesInDir(FRoot, Trim(FMask), FObjectTypes, Files, fstNone, FMaskCaseSensitivity);
GetFilesInDirectory(FRoot, Trim(FMask), FObjectTypes, Files, fstNone,
FMaskCaseSensitivity);
for i := 0 to Files.Count - 1 do
begin