[fpc-devel] wrong behaviuor of GetAppConfigDir
idokan at gmail.com
Wed Feb 4 10:52:26 CET 2009
GetAppConfigDir takes the title of the application in order to set the
directory where the project will store it's configuration.
This type of behavior is wrong because of:
1. Translating of a program (for example for Hebrew in my case) will
result in different directory
2. The title of the application might change depending on things
inside the program itself.
3. Possible of unsupported chars to be part of the directory name.
My suggestion is to do the following (it's a proof of concept and not
the real code):
function GetAppConfigDir(global : Boolean; AName : String = '') : String;
Path : String;
HomeDirectory : String;
HomeDirecory := ...
if global then
path := ...
path := HomeDirectory
if Trim(AName) <> '' then
Result := path + DirectorySeperator + Trim(AName)
Result := path + DirectorySeperator + ExeName
What do you think of it for next versions of FPC ?
More information about the fpc-devel