Some GUI Object classes call AddSetting and immediately afterwards set the value of the setting to some default.
It seems this is indirection - one could just create the object with the correct value in place instead of doing it in two steps.
This also means that the code is more grouped.
Details
- Reviewers
- None
Notice that there is a behavior change - the GUIM_SETTINGS_UPDATED message is not sent anymore in the constructor.
As far as I see this might not be a problem, but perhaps for some cases it might.
Notice that this patch might actually turn out to be impossible due to linking issues, because the compiler doesnt know in advance which template specializations to generate;
and because some Setting value classes (CGUIColor) are noncopyable.
Diff Detail
- Repository
- rP 0 A.D. Public Repository
- Branch
- /ps/trunk
- Lint
Lint OK - Unit
No Unit Test Coverage - Build Status
Buildable 9138 Build 14989: Vulcan Build Jenkins Build 14988: Vulcan Build (Windows) Jenkins Build 14987: arc lint + arc unit
Event Timeline
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/21/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/530/display/redirect
Initial setting values now provided in the class constructor following D2313, and don't need magic for that but only initializer list.