* Patch from Bart B to implement TPath.DesktopPath and TPath.AppPath

This commit is contained in:
Michaël Van Canneyt 2023-11-19 12:17:38 +01:00
parent dd78479afa
commit 92e86cb11d

View File

@ -199,8 +199,10 @@ type
class function GetTempPath: string;
class function GetHomePath: string;
class function GetDocumentsPath: string;
class function GetDesktopPath: string;
class function GetSharedDocumentsPath: string;
class function GetLibraryPath: string;
class function GetAppPath: string;
class function GetCachePath: string;
class function GetPublicPath: string;
class function GetPicturesPath: string;
@ -1139,6 +1141,20 @@ begin
{$ENDIF}
end;
class function TPath.GetDesktopPath: string;
begin
Result:='';
{$IfDef MSWINDOWS}
Result:=GetWindowsSpecialDir(CSIDL_DESKTOPDIRECTORY, False);
{$ELSE}
{$IFDEF UNIX}
Result:=GetSpecialDir(sdDesktop);
{$ELSE}
Result:=GetUserDir;
{$ENDIF}
{$EndIf}
end;
class function TPath.GetSharedDocumentsPath: string;
begin
Result:='';
@ -1162,6 +1178,11 @@ begin
{$ENDIF}
end;
class function TPath.GetAppPath: string;
begin
Result:=ExtractFilePath(ParamStr(0));
end;
class function TPath.GetCachePath: string;
begin
{$IfDef MSWINDOWS}