mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 21:28:03 +02:00
* Patch from Bart B to implement TPath.DesktopPath and TPath.AppPath
This commit is contained in:
parent
dd78479afa
commit
92e86cb11d
@ -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}
|
||||
|
Loading…
Reference in New Issue
Block a user