xbmc/xbmc — pull request #2766 by Montellese (2013-05-18 15:17:20+00:00)
Title: settings: use <visible> conditions in setting definition XML files to determine which files to load

Right now the list and name of the setting definition XML files which are used to initialize the settings system is hard-coded in CSettings::InitializeDefinitions() and depends on the platform (using TARGET_FOO defines). For XBMC forks which require special setting definitions I added "appliance.xml" which would be used on any platform. But I didn't like this limitation so I came up with a different solution.

With this change we can add any kind of XML files into the system/settings/ folder and CSettings::InitializeDefinitions() will pick them up and load them. It then first checks the tag of the XML file (inside the root tag) and evaluates it. If it evaluates to true, the file is loaded otherwise it is ignored. That way e.g. OE can just throw in an extra oe.xml file into the system/settings/ folder and specify its custom setting definitions in there.
The available visible conditions are limited to static conditions (like HAS_GL etc) and TARGET_FOO defines. Dynamic conditions are not available because they may change during runtime and may not even be properly initialized at the time the settings system is initialized.