Skip to content

Commit

Permalink
fix(icon): Removed useless calls to method ResetCacheIcon at asuite s…
Browse files Browse the repository at this point in the history
…tartup
  • Loading branch information
salvadorbs committed Oct 1, 2024
1 parent a4b7ee7 commit 1ea24e2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion Library/Icons.Base.pas
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ TBaseIcon = class

procedure ResetIcon; virtual;
procedure ResetCacheIcon;
function CheckImageIndex: Boolean;

property Name: string read GetName;
property ImageIndex: Integer read GetImageIndex;
Expand Down Expand Up @@ -127,8 +128,10 @@ function TBaseIcon.InternalLoadIcon: Integer;
sPathCacheIcon := PathCacheIcon;
if (FileExists(sPathCacheIcon)) and (CacheIconCRC = intHash) then
sTempPath := sPathCacheIcon
else
else begin
TASuiteLogger.Debug('sPathCacheIcon = %s - CacheIconCRC = %d - intHash = %d', [sPathCacheIcon, CacheIconCRC, intHash]);
ResetCacheIcon;
end;
end;

//Icon or exe
Expand Down Expand Up @@ -236,6 +239,11 @@ function TBaseIcon.LoadFromFileIcon(const APathFile: string;
end;
end;

function TBaseIcon.CheckImageIndex: Boolean;
begin
Result := FImageIndex <> -1;
end;

function TBaseIcon.InternalGetImageIndex(const APathFile: string): Integer;
var
bmpSmallIcon, bmpLargeIcon: TBGRABitmap;
Expand Down
2 changes: 1 addition & 1 deletion Library/NodeDataTypes.Files.pas
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ procedure TvFileNodeData.CheckPathFile;
if FIsPathFileExists <> bPathExists then
begin
FIsPathFileExists := bPathExists;
if Config.ASuiteState = lsNormal then
if (Config.ASuiteState = lsNormal) and (Icon.CheckImageIndex) then
Icon.ResetIcon;
end;
end;
Expand Down

0 comments on commit 1ea24e2

Please sign in to comment.