UPD: Support max depth in Copy/Move operations when template used.

This commit is contained in:
cobines 2012-04-19 09:13:42 +00:00
commit bd838bc749
2 changed files with 10 additions and 2 deletions

View file

@ -442,7 +442,6 @@ begin
edtFindPathStart.Visible := False;
cbFollowSymLinks.Visible := False;
cbPartialNameSearch.Visible := False;
cmbSearchDepth.Enabled := False;
btnStart.Visible := False;
btnStop.Visible := False;
btnNewSearch.Visible := False;

View file

@ -55,6 +55,7 @@ type
private
FFilesTree: TFileTree;
FFilesCount: Int64;
FCurrentDepth: Integer;
FDirectoriesCount: Int64;
FFilesSize: Int64;
FExcludeRootDir: Boolean;
@ -358,6 +359,7 @@ begin
FFilesSize := 0;
FFilesCount := 0;
FDirectoriesCount := 0;
FCurrentDepth := 0;
FRootDir := Files.Path;
if Assigned(FFileTemplate) then
@ -456,7 +458,14 @@ begin
if FRecursive then
begin
AddFilesInDirectory(aFile.FullPath + DirectorySeparator, AddedNode);
if not Assigned(FFileTemplate) or
(FFileTemplate.SearchRecord.SearchDepth < 0) or
(FCurrentDepth <= FFileTemplate.SearchRecord.SearchDepth) then
begin
Inc(FCurrentDepth);
AddFilesInDirectory(aFile.FullPath + DirectorySeparator, AddedNode);
Dec(FCurrentDepth);
end;
if Assigned(FFileTemplate) and FExcludeEmptyTemplateDirectories and
(AddedNode.SubNodesCount = 0) then