mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-05 19:38:36 +02:00
+ Patch from Michalis Kamburelis to implement correct config dir, following basedir-spec
git-svn-id: trunk@1719 -
This commit is contained in:
parent
367df58016
commit
59d3cd95a8
@ -1083,7 +1083,19 @@ Function GetHomeDir : String;
|
||||
begin
|
||||
Result:=GetEnvironmentVariable('HOME');
|
||||
If (Result<>'') then
|
||||
Result:=IncludeTrailingPathDelimiter(Result);
|
||||
Result:=IncludeTrailingPathDelimiter(Result);
|
||||
end;
|
||||
|
||||
{ Follows base-dir spec,
|
||||
see [http://freedesktop.org/Standards/basedir-spec].
|
||||
Always ends with PathDelim. }
|
||||
Function XdgConfigHome : String;
|
||||
begin
|
||||
Result:=GetEnvironmentVariable('XDG_CONFIG_HOME');
|
||||
if (Result='') then
|
||||
Result:=GetHomeDir + '.config/'
|
||||
else
|
||||
Result:=IncludeTrailingPathDelimiter(Result);
|
||||
end;
|
||||
|
||||
Function GetAppConfigDir(Global : Boolean) : String;
|
||||
@ -1092,7 +1104,7 @@ begin
|
||||
If Global then
|
||||
Result:=SysConfigDir
|
||||
else
|
||||
Result:=GetHomeDir+ApplicationName;
|
||||
Result:=XdgConfigHome + ApplicationName;
|
||||
end;
|
||||
|
||||
Function GetAppConfigFile(Global : Boolean; SubDir : Boolean) : String;
|
||||
@ -1114,8 +1126,7 @@ begin
|
||||
end
|
||||
else
|
||||
begin
|
||||
Result:=GetHomeDir;
|
||||
Result:=Result+'.'+ApplicationName;
|
||||
Result:=XdgConfigHome + ApplicationName + ConfigExtension;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user