DEL: Obsolete code

This commit is contained in:
Alexander Koblov 2026-05-30 20:10:53 +03:00
commit 0b6f62b153
4 changed files with 11 additions and 33 deletions

View file

@ -552,7 +552,7 @@ var
begin
isFileSystem := FFileSource.IsClass(TFileSystemFileSource);
Idx := PixMapManager.GetIconByFile(FFiles[iIndex], isFileSystem, True, sim_all_and_exe, True);
Idx := PixMapManager.GetIconByFile(FFiles[iIndex], isFileSystem, True, sim_all_and_exe);
if Idx < 0 then Idx:= PixMapManager.GetDefaultIcon(FFiles[iIndex]);
ABitmap:= PixMapManager.GetBitmap(Idx);
imgFileIcon.Picture.Bitmap := ABitmap;

View file

@ -781,8 +781,7 @@ begin
AFile,
DirectAccess,
not gLoadIconsSeparately,
gShowIcons,
not gIconOverlays);
gShowIcons);
end;
aDisplayFiles.Add(AFile);
@ -836,8 +835,7 @@ begin
AFile,
DirectAccess,
not gLoadIconsSeparately,
gShowIcons,
not gIconOverlays);
gShowIcons);
end;
// New file.
@ -955,8 +953,7 @@ begin
FWorkingFile,
DirectAccess,
True,
gShowIcons,
not gIconOverlays);
gShowIcons);
{$IF DEFINED(MSWINDOWS) OR DEFINED(RabbitVCS) OR DEFINED(XDG)}
if gIconOverlays and (FWorkingFile.IconOverlayID < 0) then

View file

@ -471,7 +471,7 @@ begin
begin
if (AFile.IconID < 0) and (AFile.Icon = nil) then
begin
AFile.IconID := PixMapManager.GetIconByFile(AFileSource, AFile, DirectAccess, True, gShowIcons, not gIconOverlays);
AFile.IconID := PixMapManager.GetIconByFile(AFileSource, AFile, DirectAccess, True, gShowIcons);
end;
{$IF DEFINED(MSWINDOWS) OR DEFINED(RabbitVCS) OR DEFINED(XDG)}
if gIconOverlays and (AFile.IconOverlayID < 0) then

View file

@ -114,8 +114,6 @@ type
FDriveIconList : array[0..2] of TDriveIconList;
FiDirIconID : PtrInt;
FiDirLinkBrokenIconID : PtrInt;
FiLinkBrokenIconID : PtrInt;
FiEmblemLinkID: PtrInt;
FiEmblemUnreadableID: PtrInt;
FiUpDirIconID : PtrInt;
@ -333,14 +331,11 @@ type
its index regardless of LoadIcon parameter.)
@param(IconsMode
Whether to retrieve only standard icon, also from file resources, etc.)
@param(GetIconWithLink
If the file is a link and GetLinkIcon is @true it retrieves icon
with embedded link bitmap. If @false it only retrieves the file icon itself.)
}
function GetIconByFile(AFile: TFile; DirectAccess: Boolean; LoadIcon: Boolean;
IconsMode: TShowIconsMode; GetIconWithLink: Boolean): PtrInt;
IconsMode: TShowIconsMode): PtrInt;
function GetIconByFile(constref AFileSource: IFileSource; AFile: TDisplayFile; DirectAccess: Boolean; LoadIcon: Boolean;
IconsMode: TShowIconsMode; GetIconWithLink: Boolean): PtrInt; overload;
IconsMode: TShowIconsMode): PtrInt; overload;
{$IF DEFINED(MSWINDOWS) OR DEFINED(RabbitVCS) OR DEFINED(XDG)}
{en
Retrieves overlay icon index for a file.
@ -680,7 +675,7 @@ begin
begin
AFile := TFileSystemFileSource.CreateFileFromFile(sFileName);
try
iIndex := GetIconByFile(AFile, True, True, sim_all_and_exe, False);
iIndex := GetIconByFile(AFile, True, True, sim_all_and_exe);
bmStandartBitmap := GetBitmap(iIndex);
if fromWhatItWasLoaded<> nil then fromWhatItWasLoaded^ := fwbwlFileIconByExtension;
finally
@ -1788,8 +1783,6 @@ begin
if FiDirIconID = -1 then
{$ENDIF}
FiDirIconID:= AddDefaultThemePixmap('folder');
FiDirLinkBrokenIconID:= AddSpecial(FiDirIconID, FiEmblemUnreadableID);
FiLinkBrokenIconID:= AddSpecial(FiDefaultIconID, FiEmblemUnreadableID);
FiUpDirIconID:= CheckAddThemePixmap('go-up');
{$IF DEFINED(MSWINDOWS) OR DEFINED(XDG)}
FiArcIconID := -1;
@ -2244,7 +2237,7 @@ begin
end;
function TPixMapManager.GetIconByFile(AFile: TFile; DirectAccess: Boolean; LoadIcon: Boolean;
IconsMode: TShowIconsMode; GetIconWithLink: Boolean): PtrInt;
IconsMode: TShowIconsMode): PtrInt;
var
Ext: String;
{$IFDEF MSWINDOWS}
@ -2268,12 +2261,6 @@ begin
Exit;
end;
if IsLinkToDirectory and GetIconWithLink then
begin
if Assigned(LinkProperty) and not LinkProperty.IsValid then
Exit(FiDirLinkBrokenIconID);
end;
if (DirectAccess = False) then
begin
if (AFile.Attributes = (FILE_ATTRIBUTE_NORMAL or FILE_ATTRIBUTE_VIRTUAL)) and Assigned(AFile.LinkProperty) then
@ -2349,12 +2336,6 @@ begin
end
else // not directory
begin
if IsLink and GetIconWithLink then
begin
if Assigned(LinkProperty) and not LinkProperty.IsValid then
Exit(FiLinkBrokenIconID);
end;
if (Extension = '') then
begin
{$IF DEFINED(UNIX) AND NOT DEFINED(HAIKU)}
@ -2535,7 +2516,7 @@ begin
end;
function TPixMapManager.GetIconByFile(constref AFileSource: IFileSource; AFile: TDisplayFile;
DirectAccess: Boolean; LoadIcon: Boolean; IconsMode: TShowIconsMode; GetIconWithLink: Boolean): PtrInt;
DirectAccess: Boolean; LoadIcon: Boolean; IconsMode: TShowIconsMode): PtrInt;
var
ABitmap: TBitmap;
begin
@ -2558,7 +2539,7 @@ begin
end;
end;
Result:= GetIconByFile(AFile.FSFile, DirectAccess, LoadIcon, IconsMode, GetIconWithLink);
Result:= GetIconByFile(AFile.FSFile, DirectAccess, LoadIcon, IconsMode);
end;
{$IF DEFINED(MSWINDOWS)}