<table><tr><td style="">tcanabrava edited the summary of this revision. <a href="https://phabricator.kde.org/transactions/detail/PHID-XACT-DREV-o52b6l3qefnwwag/">(Show Details)</a>
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D26202">View Revision</a></tr></table><br /><div><strong>CHANGES TO REVISION SUMMARY</strong><div><div style="white-space: pre-wrap; color: #74777D;"><span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">This is really a wip,</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">The current KConfigXT</span> comp<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">letely broken. It's just so people can point me to</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">iler is in a sad state:</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">the right direction</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">It's a massive file with loads of global variables that handle state, the generator is done within the main() function and it seems to have grown organically. There are no classes to separate logic / state / generation, what exists is code that generates code from a xml / ini pair, but it's hard to even discover what a bit of code is doing. The code istyle is C++ / Java from the nineties, which is not bad per see but it also uses quite a few things that are going to be deprecated in Qt 6 so I'm also taking the time make the code more streamlined with newer code style (no iterators, lambdas, auto usage, etc)</span>.<br />
<br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">Rework CfgEntry</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">The code that generates the files simplly pushes strings to a text stream, and it's hard to figure out when something starts or something ends: for instance, the code that generates the Constructor has more than sixty lines of code englobing some nested if - for - if - for constructs.</span><br />
<br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">Remove commented code</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">This code tries to Separate the compiler code into many different files / classes to be more obvious what's happening, and each class also has many helper methods to minimize copypaste.</span><br />
<br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">Add base class `KConfigCodeGenerator`, a helper to generate the Header and Source files<br />
<br />
Add new KConfigHeaderGenerator / Share the common Structs<br />
<br />
KConfigHeaderGenerator will generate the Header,</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">    CodeGenerator: Has base code for the header and source files that can be shared<br />
    HeaderGenerator: Logic for generating the header file<br />
    SourceGenerator: Logic for generating the source file</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">it uses the same structs as the kconfig_compiler.cpp<br />
<br />
Create a Struct for the parse results and use it.<br />
<br />
Fix header Generation<br />
<br />
Implement the Enums / Move Quite of code around<br />
<br />
Moved Create Constructor<br />
<br />
Move Destructor</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">    KcfgParser: Logic for parsing the kcfg file and extracting the information<br />
    CommonStructs: a header that contains the structs that are currently used everywhere.<br />
    KConfigParameters: (was CfgConfig - ConfigConfig, wat) - Has information passed via the kcfgc file<br />
    kcfg_compiler - will be renamed to main - start the other classes and generates the files.</span><br />
<br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">Move `This` and `Const` special Vars to ConfigCodeGenerator</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">This code here currently has the begining of this separation, with the CodeGenerator and the HeaderGenerator in a ~good~ state, but unfinished.</span></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R237 KConfig</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D26202">https://phabricator.kde.org/D26202</a></div></div><br /><div><strong>To: </strong>tcanabrava, Frameworks, ervin, bport<br /><strong>Cc: </strong>ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns<br /></div>