ide: inspect chksum changed: fixed updating cache

This commit is contained in:
mattias 2023-08-03 18:12:46 +02:00
parent 68920c7d01
commit 357928192e
2 changed files with 11 additions and 7 deletions

View File

@ -1325,12 +1325,15 @@ begin
// check excludes // check excludes
Cache:=DirCache.GetStarCache(StarDir,ctsdStarStar); Cache:=DirCache.GetStarCache(StarDir,ctsdStarStar);
for i:=0 to Cache.Listing.Count-1 do begin if Cache<>nil then begin
FoundFilename:=Cache.Listing.GetSubDirFilename(i); Cache.UpdateListing;
if (FoundFilename[1]='.') for i:=0 to Cache.Listing.Count-1 do begin
or (Pos(PathDelim+'.',FoundFilename)>0) FoundFilename:=Cache.Listing.GetSubDirFilename(i);
or (Pos('ignore',FoundFilename)>0) then if (FoundFilename[1]='.')
Fail('Failed to exclude "'+FoundFilename+'"'); or (Pos(PathDelim+'.',FoundFilename)>0)
or (Pos('ignore',FoundFilename)>0) then
Fail('Failed to exclude "'+FoundFilename+'"');
end;
end; end;
finally finally

View File

@ -239,7 +239,8 @@ begin
if (Dir='') or (not FilenameIsAbsolute(Dir)) then exit; if (Dir='') or (not FilenameIsAbsolute(Dir)) then exit;
// search in directory for all files that could be sources or ppu files of this unit // search in directory for all files that could be sources or ppu files of this unit
DirCache:=CodeToolBoss.DirectoryCachePool.GetCache(Dir,true,false); DirCache:=CodeToolBoss.DirectoryCachePool.GetCache(Dir,true,false);
if (DirCache=nil) or (DirCache.Listing=nil) then exit; if (DirCache=nil) then exit;
DirCache.UpdateListing;
for i:=0 to DirCache.Listing.Count-1 do begin for i:=0 to DirCache.Listing.Count-1 do begin
Filename:=DirCache.Listing.GetFilename(i); Filename:=DirCache.Listing.GetFilename(i);
if FilenameExtIn(Filename,['.pas','.pp','.p','.ppu']) if FilenameExtIn(Filename,['.pas','.pp','.p','.ppu'])