xbmc/xbmc — pull request #5632 by Montellese (2014-11-02 11:50:29+00:00)
Title: [rebrand] change default webserver username from "xbmc" to "kodi"

This PR superseeds #5596 (thanks @Memphiz for spotting it and doing half the work) and updates the default value of the webserver username setting from `xbmc` to `kodi`.

The tricky part is that the settings system contains logic to automatically update the default value of a setting if the current setting value matches the default. That however means that when someone has set the webserver username to `xbmc` (which is the old default value) but has a non-empty password set (which is not the default value) the username value would be automatically updated to `kodi` and the password would be left untouched. That would mean that users wouldn't be able to connect to the webserver with their known credentials anymore. Therefore we need to catch that case and only update the username from `xbmc` to `kodi` if no password is set.
This however wasn't possible due to the fact that both the update logic and the default value handling logic was added to the settings library afterwards and they didn't work well together. So I've fixed the settings library behaviour to only update the default value if the setting wasn't updated through an update handler. That allows us to use the update handler written by @Memphiz which checks the username and password combination and can therefore force the settings system to not update the default value if the username is `xbmc` and the password is not empty.