mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-26 05:09:12 +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 GetTempPath: string;
|
||||||
class function GetHomePath: string;
|
class function GetHomePath: string;
|
||||||
class function GetDocumentsPath: string;
|
class function GetDocumentsPath: string;
|
||||||
|
class function GetDesktopPath: string;
|
||||||
class function GetSharedDocumentsPath: string;
|
class function GetSharedDocumentsPath: string;
|
||||||
class function GetLibraryPath: string;
|
class function GetLibraryPath: string;
|
||||||
|
class function GetAppPath: string;
|
||||||
class function GetCachePath: string;
|
class function GetCachePath: string;
|
||||||
class function GetPublicPath: string;
|
class function GetPublicPath: string;
|
||||||
class function GetPicturesPath: string;
|
class function GetPicturesPath: string;
|
||||||
@ -1139,6 +1141,20 @@ begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
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;
|
class function TPath.GetSharedDocumentsPath: string;
|
||||||
begin
|
begin
|
||||||
Result:='';
|
Result:='';
|
||||||
@ -1162,6 +1178,11 @@ begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
class function TPath.GetAppPath: string;
|
||||||
|
begin
|
||||||
|
Result:=ExtractFilePath(ParamStr(0));
|
||||||
|
end;
|
||||||
|
|
||||||
class function TPath.GetCachePath: string;
|
class function TPath.GetCachePath: string;
|
||||||
begin
|
begin
|
||||||
{$IfDef MSWINDOWS}
|
{$IfDef MSWINDOWS}
|
||||||
|
Loading…
Reference in New Issue
Block a user