xbmc/xbmc — pull request #3394 by groth-its (2013-10-07 21:30:58+00:00)
Title: Fix: Pathsubstitution for RssFeeds.xml by ensuring the order ISettingsHandlers are registered

Since the new concept of settings after Frodo, the pathsubstitution for - at least - "special://profile/RssFeeds.xml", to a file on a samba share, is broken for me.

After some investigation through the sources I found, that the order of invocation of the callback functions defined in ISettingHandlers, depends on the way their pointers are sorted into a set. The sorting seems to follow a comparison of the pointer addresses.
This leads to the advancedsettings.xml being handled after RssManager, which is why the pathsubstitution is ignored at least for the RssFeeds.xml.

My implementation works around this issue by using std::vector instead of std::set. This way the order ISettingsHandlers are registered is preserved, while CSettingsManager::RegisterSettingsHandler takes care of avoiding duplicates. Searching in an unsorted vector might not be fast, but these vectors are not that long anyway.

I am not a 100% sure about the order I decided to register the callback functions. But my tests brought up no problems so far.