[Scummvm-devel] Configuration domains

Max Horn max at quendi.de
Sat Apr 22 04:49:00 CEST 2006


Am 20.04.2006 um 11:29 schrieb Lars Persson:

[...]

>>> I would like to have a config domain called symbian for Symbian   
>>> specific
>>> configurations, such as key settings etc, and I would guess that  
>>> if  every
>>> port would add its own domain in the config-manager files, it  
>>> would  become
>>> quite clumsy in the end.
>>
>> How many people move a single config file between multiple  
>> computers  with different OSes all the time, I wonder? I'd not  
>> worry about those  much, really.
>
> Well.. I thought about the cpp file beeing riddled with alot of  
> #ifdef PLATFORM for different domains. But as you said, platform  
> specific domains could be added in a different form than it has  
> been before.

We wouldn't do it with #ifdefs anymore. Rather, we could (if desired  
by porters) add a new API to ConfigManager, something like

    void addSpecialDomain(String domName);
    Domain *getSpecialDomain(String domName);
    void removeSpecialDomain(String domName);

which can be used to add custom domains outside the default search  
order of the ConfigManager.

Clearly, it's not really nice to have all these special cases (active  
domain, game domains, special domains, ...) in the ConfigManager API.  
The problem here is that ConfigManager currently has to do two  
different jobs: Manage access to the active settings, and manage  
access to *all* domains found in our config file.

I plan to change that eventually. There will be one API to access  
only the active settings; and another API (possible in another object  
underneath / parallel to the ConfigManager) which handles access to  
the actual domains in the config file. That later manager would just  
allow you to iterate over all domains; for each domain, you have a  
"type" value (app / game / special / ???). This latter API would be  
used by the launcher, to add/edit games; while most of the remaining  
code would never worry about all this.



>>> All comments are welcome. Right now I am adding my keysettings in  
>>> the
>>> application domain, but don't think that is appropriate in the  
>>> long  run.
>>
>> Why exactly do you think that? (This is not a rhetoric question)
>
> Well.. I just thought that the app domain should be some kind of  
> private. But of course, if for example keysettings would be an  
> appropriate  to put in the app domain, then I will continue to do  
> so, and thus keep things as simple as possible.

I don't really see why having the keysettings in the app domain is a  
problem. However, I don't want to give the impression that I am just  
too lazy to (re)add special domains. I just wonder if this is "only"  
for aesthetically reasons, or if there are strong arguments for it...

The one "real" argument I can think of is that somebody might want to  
move a config file back & forth between different machines, and if  
each of them had their own custom settings, they might clash, so it  
would be nicer to put them into a "namespace" (read: "special  
domain"), so that the symbian config can't conflict with the WinCE or  
DC or Mac OS X custom config keys. Alas, that's IMO a rather rare  
usage scenario. :-)



Cheers,
Max





More information about the Scummvm-devel mailing list