codetools: accelerated loading include links

git-svn-id: trunk@14190 -
This commit is contained in:
mattias 2008-02-19 11:37:30 +00:00
parent fc54ba9a4c
commit e0c523e862

View File

@ -708,6 +708,7 @@ var LinkCnt, i: integer;
LastTimeUsed, CurrDate: TDateTime; LastTimeUsed, CurrDate: TDateTime;
IncludeFilename, IncludedByFile, APath: string; IncludeFilename, IncludedByFile, APath: string;
NewLink: TIncludedByLink; NewLink: TIncludedByLink;
CurrDateStr: String;
begin begin
try try
FIncludeLinks.FreeAndClear; FIncludeLinks.FreeAndClear;
@ -716,14 +717,13 @@ begin
FExpirationTimeInDays); FExpirationTimeInDays);
LinkCnt:=XMLConfig.GetValue(XMLPath+'IncludeLinks/Count',0); LinkCnt:=XMLConfig.GetValue(XMLPath+'IncludeLinks/Count',0);
CurrDate:=Date; CurrDate:=Date;
CurrDateStr:=DateToStr(CurrDate);
for i:=0 to LinkCnt-1 do begin for i:=0 to LinkCnt-1 do begin
APath:=XMLPath+'IncludeLinks/Link'+IntToStr(i)+'/'; APath:=XMLPath+'IncludeLinks/Link'+IntToStr(i)+'/';
try if not TryStrToDate(XMLConfig.GetValue(APath+'LastTimeUsed/Value',
LastTimeUsed:=StrToDate(XMLConfig.GetValue(APath+'LastTimeUsed/Value', CurrDateStr),LastTimeUsed)
DateToStr(CurrDate))); then
except
LastTimeUsed:=CurrDate; LastTimeUsed:=CurrDate;
end;
// ToDo: check if link has expired // ToDo: check if link has expired