+ Patch from Michalis Kamburelis to implement correct config dir, following basedir-spec

git-svn-id: trunk@1719 -
This commit is contained in:
michael 2005-11-10 20:40:11 +00:00
parent 367df58016
commit 59d3cd95a8

View File

@ -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;