mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
UPD: When searching for a theme icon only need to scan directories that have size distance less than already found minimum.
This commit is contained in:
parent
3ad7240708
commit
a4e06d9f97
1 changed files with 12 additions and 12 deletions
|
|
@ -328,22 +328,22 @@ begin
|
|||
begin
|
||||
for I:= 0 to FDirectories.Count - 1 do
|
||||
begin
|
||||
if not Assigned(FDirectories.Items[I]^.FileListCache[J]) then
|
||||
CacheDirectoryFiles(I, J);
|
||||
NewSize:= DirectorySizeDistance(I, AIconSize);
|
||||
|
||||
FoundIndex:= FDirectories.Items[I]^.FileListCache[J].Find(AIconName);
|
||||
if FoundIndex >= 0 then
|
||||
if NewSize < MinimalSize then
|
||||
begin
|
||||
NewSize:= DirectorySizeDistance(I, AIconSize);
|
||||
if NewSize = 0 then // exact match
|
||||
if not Assigned(FDirectories.Items[I]^.FileListCache[J]) then
|
||||
CacheDirectoryFiles(I, J);
|
||||
|
||||
FoundIndex:= FDirectories.Items[I]^.FileListCache[J].Find(AIconName);
|
||||
if FoundIndex >= 0 then
|
||||
begin
|
||||
MakeResult;
|
||||
Exit;
|
||||
end
|
||||
else if NewSize < MinimalSize then
|
||||
begin
|
||||
MakeResult;
|
||||
MinimalSize:= NewSize;
|
||||
|
||||
if NewSize = 0 then // exact match
|
||||
Exit
|
||||
else
|
||||
MinimalSize:= NewSize;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue