This is the last step of the GUIutil.h rewrite. There was a dozen of commits removing random miscellaneous helper functions from this file and inserting them at the correct location or superseding them otherwise,
and some inserting the setting management here.
The last function, ParseString seems best to be moved to CGUI, at least if one wants all ParseString functions to be in the same class or namespace.
Notice that some of the ParseString functions can be moved to the classes itself, but this is not possible for example for the enums or primitives.
So it seems cleaner to keep them grouped and move them to CGUI, as at least for the color, it needs to know the CGUI page (as that defines the predefined colors which influence the result).
Notice that someone would have to spend love on the GUI tests in order to make this a non-static function.
If the CGUI object is created in the testcode, many more tests may be added. Then.
Details
Details
- Reviewers
- None
- Commits
- rP22801: Solemnly delete class GUI and rename GUIUtil.h to CGUISetting.h.
- Trac Tickets
- #5575
Notice that the purpose is mostly to remove the class and rename the file, not to fix all issues with that function (most prominently it should become a member, not static).
Diff Detail
Diff Detail
- Repository
- rP 0 A.D. Public Repository
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Comment Actions
Successful build - Chance fights ever on the side of the prudent.
Linter detected issues: Executing section Source... source/gui/CGUIText.h | 51| class·CGUIText | | [MAJOR] CPPCheckBear (syntaxError): | | Code 'classCGUIText{' is invalid C code. Use --std or --language to configure the language. source/gui/tests/test_ParseString.h | 24| class·TestGuiParseString·:·public·CxxTest::TestSuite | | [MAJOR] CPPCheckBear (syntaxError): | | Code 'classTestGuiParseString:' is invalid C code. Use --std or --language to configure the language. source/gui/CGUISetting.h | 28| class·IGUISetting | | [MAJOR] CPPCheckBear (syntaxError): | | Code 'classIGUISetting{' is invalid C code. Use --std or --language to configure the language. source/gui/CGUI.h | 27| #include·"GUIbase.h" | | [MAJOR] CPPCheckBear (syntaxError): | | Code 'classGUITooltip{' is invalid C code. Use --std or --language to configure the language. source/gui/IGUIButtonBehavior.h | 50| class·IGUIButtonBehavior·:·virtual·public·IGUIObject | | [MAJOR] CPPCheckBear (syntaxError): | | Code 'classIGUIButtonBehavior:' is invalid C code. Use --std or --language to configure the language. source/gui/GUI.h | 23| #include·<string> | | [MAJOR] CPPCheckBear (syntaxError): | | Code 'classCGUIList{' is invalid C code. Use --std or --language to configure the language. Executing section JS... Executing section cli...
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/510/display/redirect