ADD: FTP - custom icons

(cherry picked from commit 3ebc9c7d7e)
This commit is contained in:
Alexander Koblov 2026-01-05 17:41:27 +03:00
commit 205656bc90
2 changed files with 22 additions and 0 deletions

View file

@ -37,6 +37,7 @@ exports
FsSetDefaultParams,
FsStatusInfoW,
FsGetBackgroundFlags,
FsExtractCustomIconW,
{
FsNetworkGetSupportedProtocols,
FsNetworkGetConnection,

View file

@ -96,6 +96,7 @@ procedure FsGetDefRootName(DefRootName: PAnsiChar; MaxLen: Integer); dcpcall; ex
procedure FsSetDefaultParams(dps: pFsDefaultParamStruct); dcpcall; export;
procedure FsStatusInfoW(RemoteDir: PWideChar; InfoStartEnd, InfoOperation: Integer); dcpcall; export;
function FsGetBackgroundFlags: Integer; dcpcall; export;
function FsExtractCustomIconW(RemoteName: PWideChar; ExtractFlags: Integer; TheIcon: PWfxIcon): Integer; dcpcall; export;
{ Network API }
{
procedure FsNetworkGetSupportedProtocols(Protocols: PAnsiChar; MaxLen: LongInt); dcpcall; export;
@ -1087,6 +1088,26 @@ begin
Result:= BG_DOWNLOAD or BG_UPLOAD or BG_ASK_USER;
end;
function FsExtractCustomIconW(RemoteName: PWideChar; ExtractFlags: Integer; TheIcon: PWfxIcon): Integer; dcpcall; export;
var
asRemoteName: String;
begin
Result:= FS_ICON_USEDEFAULT;
if (ExtractFileDir(RemoteName) = PathDelim) then
begin
if RemoteName[1] = '<' then
begin
Result:= FS_ICON_EXTRACTED;
TheIcon^.Format:= FS_ICON_FORMAT_FILE;
asRemoteName:= CeUtf16ToUtf8(RemoteName + 1);
if asRemoteName = cAddConnection then
StrPCopy(RemoteName, 'list-add')
else if asRemoteName = cQuickConnection then
StrPCopy(RemoteName, 'view-file');
end;
end;
end;
{
procedure FsNetworkGetSupportedProtocols(Protocols: PAnsiChar; MaxLen: LongInt); dcpcall; export;
begin