UPD: If template has IsNotOlderThan option then recalculate date/time file checks before checking because it depends on current time.

This commit is contained in:
cobines 2012-05-21 13:50:53 +00:00
commit 08ddd1447d
2 changed files with 6 additions and 0 deletions

View file

@ -92,6 +92,8 @@ type
procedure SearchTemplateToFindFileChecks(const SearchTemplate: TSearchTemplateRec;
out FileChecks: TFindFileChecks);
procedure DateTimeOptionsToChecks(const SearchTemplate: TSearchTemplateRec;
var FileChecks: TFindFileChecks);
function CheckDirectoryName(const FileChecks: TFindFileChecks; const DirectoryName: String) : Boolean;
function CheckDirectoryNameRelative(const FileChecks: TFindFileChecks; const FullPath, BasePath: String) : Boolean;

View file

@ -102,6 +102,10 @@ end;
function TSearchTemplate.CheckFile(const AFile: TFile): Boolean;
begin
// If template has IsNotOlderThan option then DateTime checks must be recalculated
// everytime because they depend on current time.
if FSearchRecord.IsNotOlderThan then
DateTimeOptionsToChecks(FSearchRecord, FFileChecks);
Result := uFindFiles.CheckFile(FSearchRecord, FFileChecks, AFile);
end;