Skip to content

Commit fa4a14a

Browse files
committed
chore: remove dead code
No longer used functions: GetShellFolder, GetSystemImageList, GetSystemImageIndex, GetProductInfo, GetCurrentPackageFullName, ToggleCheckBoxWithoutClick, WebColorStrToColorDef
1 parent 6f5a2d1 commit fa4a14a

File tree

3 files changed

+0
-81
lines changed

3 files changed

+0
-81
lines changed

source/apphelpers.pas

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,6 @@ TAppSettings = class(TObject)
341341
procedure StripNewLines(var txt: String; Replacement: String=' ');
342342
function GetLineBreak(LineBreakIndex: TLineBreaks): String;
343343
procedure RemoveNullChars(var Text: String; var HasNulls: Boolean);
344-
//function GetShellFolder(FolderId: TGUID): String;
345344
function ValidFilename(Str: String): String;
346345
function FormatNumber( str: String; Thousands: Boolean=True): String; Overload;
347346
function UnformatNumber(Val: String): String;
@@ -412,23 +411,17 @@ TAppSettings = class(TObject)
412411
function f_(const Pattern: string; const Args: array of const): string;
413412
function GetOutputFilename(FilenameWithPlaceholders: String; DBObj: TDBObject): String;
414413
function GetOutputFilenamePlaceholders: TStringList;
415-
//function GetSystemImageList: TImageList;
416-
//function GetSystemImageIndex(Filename: String): Integer;
417414
function GetExecutableBits: Byte;
418415
procedure Help(Sender: TObject; Anchor: String);
419416
function PortOpen(Port: Word): Boolean;
420-
//function GetProductInfo(dwOSMajorVersion, dwOSMinorVersion, dwSpMajorVersion, dwSpMinorVersion: DWORD; out pdwReturnedProductType: DWORD): BOOL stdcall; external kernel32 delayed;
421-
//function GetCurrentPackageFullName(out Len: Cardinal; Name: PWideChar): Integer; stdcall; external kernel32 delayed;
422417
function GetThemeColor(Color: TColor): TColor;
423418
function ThemeIsDark(ThemeName: String=''): Boolean;
424419
function ProcessExists(pid: Cardinal; ExeNamePattern: String): Boolean;
425-
//procedure ToggleCheckBoxWithoutClick(chk: TCheckBox; State: Boolean);
426420
function SynCompletionProposalPrettyText(ImageIndex: Integer; LeftText, CenterText, RightText: String; LeftColor: TColor=-1; CenterColor: TColor=-1; RightColor: TColor=-1): String;
427421
function PopupComponent(Sender: TObject): TComponent;
428422
function IsWine: Boolean;
429423
function DirSep: Char;
430424
procedure FindComponentInstances(BaseForm: TComponent; ClassType: TClass; var List: TObjectList<TComponent>);
431-
//function WebColorStrToColorDef(WebColor: string; Default: TColor): TColor;
432425
function GetOS: String;
433426
function UserAgent(OwnerComponent: TComponent): String;
434427
function CodeIndent(Steps: Integer=1): String;
@@ -954,25 +947,6 @@ procedure RemoveNullChars(var Text: String; var HasNulls: Boolean);
954947
end;
955948

956949

957-
{***
958-
Get the path of a Windows(r)-shellfolder, specified by a KNOWNFOLDERID constant
959-
@see https://docs.microsoft.com/en-us/windows/win32/shell/knownfolderid
960-
@param TGUID constant
961-
@return string Path
962-
}
963-
{function GetShellFolder(FolderId: TGUID): String;
964-
var
965-
Path: PWideChar;
966-
begin
967-
if Succeeded(SHGetKnownFolderPath(FolderId, 0, 0, Path)) then begin
968-
Result := Path;
969-
end else begin
970-
Result := EmptyStr;
971-
end;
972-
end;}
973-
974-
975-
976950
{***
977951
Remove special characters from a filename
978952
@@ -2754,35 +2728,6 @@ function GetOutputFilenamePlaceholders: TStringList;
27542728
end;
27552729

27562730

2757-
{function GetSystemImageList: TImageList;
2758-
var
2759-
Info: TSHFileInfo;
2760-
ImageListHandle: Cardinal;
2761-
begin
2762-
// Create shared imagelist once and use in TPopupMenu and TVirtualTree or whatever
2763-
if SystemImageList = nil then begin
2764-
ImageListHandle := SHGetFileInfo('', 0, Info, SizeOf(Info), SHGFI_SYSICONINDEX or SHGFI_SMALLICON);
2765-
if ImageListHandle <> 0 then begin
2766-
SystemImageList := TImageList.Create(MainForm);
2767-
SystemImageList.Handle := ImageListHandle;
2768-
SystemImageList.ShareImages := true;
2769-
SystemImageList.DrawingStyle := dsTransparent;
2770-
end;
2771-
end;
2772-
Result := SystemImageList;
2773-
end;}
2774-
2775-
2776-
{function GetSystemImageIndex(Filename: String): Integer;
2777-
var
2778-
Info: TSHFileInfo;
2779-
begin
2780-
// Return image index of shared system image list, for a given filename
2781-
SHGetFileInfo(PChar(Filename), 0, Info, SizeOf(Info), SHGFI_SYSICONINDEX or SHGFI_TYPENAME);
2782-
Result := Info.iIcon;
2783-
end;}
2784-
2785-
27862731
function GetExecutableBits: Byte;
27872732
begin
27882733
{$IfDef CPU32}
@@ -2866,17 +2811,6 @@ function ProcessExists(pid: Cardinal; ExeNamePattern: String): Boolean;
28662811
end;
28672812

28682813

2869-
{procedure ToggleCheckBoxWithoutClick(chk: TCheckBox; State: Boolean);
2870-
var
2871-
ClickEvent: TNotifyEvent;
2872-
begin
2873-
ClickEvent := chk.OnClick;
2874-
chk.OnClick := nil;
2875-
chk.Checked := State;
2876-
chk.OnClick := ClickEvent;
2877-
end;}
2878-
2879-
28802814
function SynCompletionProposalPrettyText(ImageIndex: Integer; LeftText, CenterText, RightText: String;
28812815
LeftColor: TColor=-1; CenterColor: TColor=-1; RightColor: TColor=-1): String;
28822816
const
@@ -2954,15 +2888,6 @@ procedure FindComponentInstances(BaseForm: TComponent; ClassType: TClass; var Li
29542888
end;
29552889
end;
29562890

2957-
{function WebColorStrToColorDef(WebColor: string; Default: TColor): TColor;
2958-
begin
2959-
try
2960-
Result := WebColorStrToColor(WebColor);
2961-
except
2962-
Result := Default;
2963-
end;
2964-
end;}
2965-
29662891

29672892
function GetOS: String;
29682893
begin

source/insertfiles.pas

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ implementation
118118
procedure TfrmInsertFiles.FormCreate(Sender: TObject);
119119
begin
120120
HasSizeGrip := True;
121-
//ListFiles.Images := GetSystemImageList;
122121
//DragAcceptFiles(Handle, True);
123122
FixVT(ListFiles);
124123
FixVT(ListColumns);
@@ -384,7 +383,6 @@ procedure TfrmInsertFiles.AddFile(Filename: String);
384383
Exit;
385384
FileInfo := TFileInfo.Create;
386385
FileInfo.Filename := Filename;
387-
//FileInfo.ImageIndex := GetSystemImageIndex(Filename);
388386
FileInfo.Size := _GetFileSize(Filename);
389387
rx := TRegExpr.Create;
390388
// Decide if file is binary by excluding common text format file extensions

source/main.pas

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5089,9 +5089,6 @@ procedure TMainForm.PopupQueryLoadPopup(Sender: TObject);
50895089
// Fill the popupQueryLoad menu
50905090
popupQueryLoad.Items.Clear;
50915091

5092-
// Apply shared system image list
5093-
//popupQueryLoad.Images := GetSystemImageList;
5094-
50955092
// Snippets
50965093
SetSnippetFilenames;
50975094
SnippetsFolder := TMenuItem.Create(popupQueryLoad);
@@ -5119,7 +5116,6 @@ procedure TMainForm.PopupQueryLoadPopup(Sender: TObject);
51195116
Item := TMenuItem.Create( popupQueryLoad );
51205117
Item.Caption := IntToStr(j) + ' ' + Filename;
51215118
Item.OnClick := popupQueryLoadClick;
5122-
//Item.ImageIndex := GetSystemImageIndex(Filename);
51235119
popupQueryLoad.Items.Add(Item);
51245120
end;
51255121

0 commit comments

Comments
 (0)