[fpc-devel] GetAppConfigFile

Vinzent Höfler JeLlyFish.software at gmx.net
Sat Oct 4 14:35:12 CEST 2008


Micha Nelissen wrote:

> Why is there a parameter to GetAppConfigFile? I'd suggest something like:
> 
> function GetAppConfigFile: string;
> begin
>   { first look for user specific config file }
>   Result := GetAppConfigFile(false);
>   if FileExists(Result) then
>     exit;
>   { otherwise use global one }
>   Result := GetAppConfigFile(true);
> end;

No. Because one wants the path name of the local configuration, checking 
for existance of the file is a completely different issue.

Often, after a first install, the local config does not exist yet (or 
the user may have deleted it), so your proposed approach would 
completely disable the local config then, because without the proper 
path name there's no chance to recreate the file. Considering that the 
global config is not even writable in most sane circumstances, this 
would also disable storing any settings in the file by the application.

In short: It would render the whole thing quite useless.

> (BTW: instead of Boolean, I would have liked a acLocal, acGlobal better, 
> it's clearer to read).

Agreed. But it's as it is, I guess. It was broken so often, can't do 
that again... ;)


Vinzent.



More information about the fpc-devel mailing list