D26202: WIP: Refactor KConfigXT

2020-01-19 Thread David Faure
dfaure requested changes to this revision.
dfaure added a comment.
This revision now requires changes to proceed.


  Please remove the "WIP" from the commit log (and from phabricator, which only 
gets updated if you do `arc diff --verbatim`)

REPOSITORY
  R237 KConfig

REVISION DETAIL
  https://phabricator.kde.org/D26202

To: tcanabrava, #frameworks, ervin, bport, dfaure
Cc: cgiboudeaux, kossebau, bport, ngraham, kde-frameworks-devel, LeGast00n, 
GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2020-01-18 Thread Tomaz Canabrava
tcanabrava added a comment.


  Aparently the kmymoney issue was the same: empty kconfig file. I just 
successfully compiled kdevelop and kmymoney.
  I'll let the computer to compile the whole kde applications from scratch 
tonigth to see if it will fail somewhere.

REPOSITORY
  R237 KConfig

REVISION DETAIL
  https://phabricator.kde.org/D26202

To: tcanabrava, #frameworks, ervin, bport, dfaure
Cc: cgiboudeaux, kossebau, bport, ngraham, kde-frameworks-devel, LeGast00n, 
GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2020-01-18 Thread Tomaz Canabrava
tcanabrava updated this revision to Diff 73846.
tcanabrava added a comment.


  - Revert "Revert "WIP: Refactor KConfigXT""
  - Add Reference files for Broken KDevelop Configuration
  - Fix generating of empty configuration files

REPOSITORY
  R237 KConfig

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D26202?vs=73688=73846

BRANCH
  rework_kconfig_compiler

REVISION DETAIL
  https://phabricator.kde.org/D26202

AFFECTED FILES
  autotests/kconfig_compiler/CMakeLists.txt
  autotests/kconfig_compiler/kconfigcompiler_test.cpp
  autotests/kconfig_compiler/test1.h.ref
  autotests/kconfig_compiler/test10.h.ref
  autotests/kconfig_compiler/test11.h.ref
  autotests/kconfig_compiler/test11a.h.ref
  autotests/kconfig_compiler/test12.h.ref
  autotests/kconfig_compiler/test13.h.ref
  autotests/kconfig_compiler/test9.h.ref
  autotests/kconfig_compiler/test_dpointer.cpp.ref
  autotests/kconfig_compiler/test_emptyentries.cpp.ref
  autotests/kconfig_compiler/test_emptyentries.h.ref
  autotests/kconfig_compiler/test_emptyentries.kcfg
  autotests/kconfig_compiler/test_emptyentries.kcfgc
  autotests/kconfig_compiler/test_emptyentries_main.cpp
  autotests/kconfig_compiler/test_translation_kde.h.ref
  autotests/kconfig_compiler/test_translation_kde_domain.h.ref
  autotests/kconfig_compiler/test_translation_qt.h.ref
  autotests/kconfigtest.h
  src/kconfig_compiler/CMakeLists.txt
  src/kconfig_compiler/KCFGXmlParser.cpp
  src/kconfig_compiler/KCFGXmlParser.h
  src/kconfig_compiler/KConfigCodeGeneratorBase.cpp
  src/kconfig_compiler/KConfigCodeGeneratorBase.h
  src/kconfig_compiler/KConfigCommonStructs.h
  src/kconfig_compiler/KConfigHeaderGenerator.cpp
  src/kconfig_compiler/KConfigHeaderGenerator.h
  src/kconfig_compiler/KConfigSourceGenerator.cpp
  src/kconfig_compiler/KConfigSourceGenerator.h
  src/kconfig_compiler/KConfigXTParameters.cpp
  src/kconfig_compiler/KConfigXTParameters.h
  src/kconfig_compiler/kconfig_compiler.cpp

To: tcanabrava, #frameworks, ervin, bport, dfaure
Cc: cgiboudeaux, kossebau, bport, ngraham, kde-frameworks-devel, LeGast00n, 
GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2020-01-18 Thread Tomaz Canabrava
tcanabrava added a comment.


  who knew? This actually was not a false positive: the kdevelop build failure 
was a bug in kdevelop.
  I already opened a ticket: 
https://invent.kde.org/kde/kdevelop/merge_requests/90
  but at the same time I added code to handle the case of broken / empty 
kconfigxt.

REPOSITORY
  R237 KConfig

REVISION DETAIL
  https://phabricator.kde.org/D26202

To: tcanabrava, #frameworks, ervin, bport, dfaure
Cc: cgiboudeaux, kossebau, bport, ngraham, kde-frameworks-devel, LeGast00n, 
GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2020-01-17 Thread Friedrich W. H. Kossebau
kossebau added a comment.


  In D26202#595817 , @kossebau wrote:
  
  > where "full" would also need to mean "clean fresh build dirs" :) so that 
the codegenerator is triggered to be run, as the current cmake code seems to 
not inject a build dep between generator instance and generated files, so a new 
version does not trigger regeneration. Something that could also get a fix 
perhaps, IIRC other tools have such a dep.
  
  
  D26723  now up to fix the automatic 
rebuild on new versions of kconfig_compiler.

REPOSITORY
  R237 KConfig

REVISION DETAIL
  https://phabricator.kde.org/D26202

To: tcanabrava, #frameworks, ervin, bport, dfaure
Cc: kossebau, bport, ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, 
bruns


D26202: WIP: Refactor KConfigXT

2020-01-17 Thread Christophe Giboudeaux
cgiboudeaux added a comment.


  In D26202#595846 , @tcanabrava 
wrote:
  
  > I Just reverted this and I'm working on a full build of kde using 
kdesrc-build --refresh-build, I'll reopen this patch when *all* projects build 
sucessfully, with a unittest for each one that broke.
  
  
  Thanks. Don't forget to change the title when done ;)

REPOSITORY
  R237 KConfig

REVISION DETAIL
  https://phabricator.kde.org/D26202

To: tcanabrava, #frameworks, ervin, bport, dfaure
Cc: cgiboudeaux, kossebau, bport, ngraham, kde-frameworks-devel, LeGast00n, 
GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2020-01-17 Thread Tomaz Canabrava
tcanabrava reopened this revision.
tcanabrava added a comment.
This revision is now accepted and ready to land.


  Reopening for review :)

REPOSITORY
  R237 KConfig

REVISION DETAIL
  https://phabricator.kde.org/D26202

To: tcanabrava, #frameworks, ervin, bport, dfaure
Cc: kossebau, bport, ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, 
bruns


D26202: WIP: Refactor KConfigXT

2020-01-17 Thread Tomaz Canabrava
tcanabrava requested review of this revision.

REPOSITORY
  R237 KConfig

REVISION DETAIL
  https://phabricator.kde.org/D26202

To: tcanabrava, #frameworks, ervin, bport, dfaure
Cc: kossebau, bport, ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, 
bruns


D26202: WIP: Refactor KConfigXT

2020-01-17 Thread Tomaz Canabrava
tcanabrava added a comment.


  In D26202#595820 , @tcanabrava 
wrote:
  
  > We can revert, and I’ll fix the full build. Doing that now.
  
  
  I Just reverted this and I'm working on a full build of kde using 
kdesrc-build --refresh-build, I'll reopen this patch when *all* projects build 
sucessfully, with a unittest for each one that broke.

REPOSITORY
  R237 KConfig

REVISION DETAIL
  https://phabricator.kde.org/D26202

To: tcanabrava, #frameworks, ervin, bport, dfaure
Cc: kossebau, bport, ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, 
bruns


D26202: WIP: Refactor KConfigXT

2020-01-17 Thread Tomaz Canabrava
tcanabrava added a comment.


  We can revert, and I’ll fix the full build. Doing that now.

REPOSITORY
  R237 KConfig

REVISION DETAIL
  https://phabricator.kde.org/D26202

To: tcanabrava, #frameworks, ervin, bport, dfaure
Cc: kossebau, bport, ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, 
bruns


Re: D26202: WIP: Refactor KConfigXT

2020-01-17 Thread Tomaz Canabrava
We can revert, and I’ll fix the full build. Doing that now.

On Fri, 17 Jan 2020 at 09:03 Friedrich W. H. Kossebau <
nore...@phabricator.kde.org> wrote:

> kossebau added a comment. View Revision
> 
>
> where "full" would also need to mean "clean fresh build dirs" :) so that
> the codegenerator is triggered to be run, as the current cmake code seems
> to not inject a build dep between generator instance and generated files,
> so a new version does not trigger regeneration. Something that could also
> get a fix perhaps, IIRC other tools have such a dep.
>
> *REPOSITORY*
> R237 KConfig
>
> *REVISION DETAIL*
> https://phabricator.kde.org/D26202
>
> *To: *tcanabrava, Frameworks, ervin, bport, dfaure
> *Cc: *kossebau, bport, ngraham, kde-frameworks-devel, LeGast00n, GB_2,
> michaelh, bruns
>


D26202: WIP: Refactor KConfigXT

2020-01-17 Thread Friedrich W. H. Kossebau
kossebau added a comment.


  where "full" would also need to mean "clean fresh build dirs" :) so that the 
codegenerator is triggered to be run, as the current cmake code seems to not 
inject a build dep between generator instance and generated files, so a new 
version does not trigger regeneration. Something that could also get a fix 
perhaps, IIRC other tools have such a dep.

REPOSITORY
  R237 KConfig

REVISION DETAIL
  https://phabricator.kde.org/D26202

To: tcanabrava, #frameworks, ervin, bport, dfaure
Cc: kossebau, bport, ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, 
bruns


D26202: WIP: Refactor KConfigXT

2020-01-17 Thread David Faure
dfaure added a comment.


  Argh, I wanted to say "please do a full kdesrc-build of all modules" before 
approving, and forgot to do that.

REPOSITORY
  R237 KConfig

REVISION DETAIL
  https://phabricator.kde.org/D26202

To: tcanabrava, #frameworks, ervin, bport, dfaure
Cc: kossebau, bport, ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, 
bruns


D26202: WIP: Refactor KConfigXT

2020-01-17 Thread Friedrich W. H. Kossebau
kossebau added a comment.


  This morning it was found e.g. on opensuse build server (but reproduced by me 
locally) that this change broke KMyMoney & KDevelop, who now start to fail e.g. 
with (using `VERBOSE=1 make`)
  
[ 38%] Generating kcfg_custombuildsystemconfig.h, 
kcfg_custombuildsystemconfig.cpp
cd 
/home/koder/Kode/kdegit/build/kf5/extragear/kdevelop/kdevelop/plugins/custom-buildsystem
 && /home/koder/System/opt/kf5/lib64/libexec/kf5/kconfig_compiler_kf5 
/home/koder/Kode/kdegit/kf5/extragear/kdevelop/kdevelop/plugins/custom-buildsystem/kcfg_custombuildsystemconfig.kcfg
 
/home/koder/Kode/kdegit/kf5/extragear/kdevelop/kdevelop/plugins/custom-buildsystem/kcfg_custombuildsystemconfig.kcfgc
 -d 
/home/koder/Kode/kdegit/build/kf5/extragear/kdevelop/kdevelop/plugins/custom-buildsystem/
No entries.
make[2]: *** 
[plugins/custom-buildsystem/CMakeFiles/kdevcustombuildsystem.dir/build.make:71: 
plugins/custom-buildsystem/kcfg_custombuildsystemconfig.h] Fehler 1
  
  See 
https://phabricator.kde.org/source/kdevelop/browse/master/plugins/custom-buildsystem/
 for the respecive kfg files.
  
  No time to investigate myself, but given this breaks existing codebase it 
should be quickly investigated or reverted for now. Do not shoot the messenger 
:)

REPOSITORY
  R237 KConfig

REVISION DETAIL
  https://phabricator.kde.org/D26202

To: tcanabrava, #frameworks, ervin, bport, dfaure
Cc: kossebau, bport, ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, 
bruns


D26202: WIP: Refactor KConfigXT

2020-01-16 Thread Tomaz Canabrava
This revision was automatically updated to reflect the committed changes.
Closed by commit R237:98c32e29f504: WIP: Refactor KConfigXT (authored by 
tcanabrava).

REPOSITORY
  R237 KConfig

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D26202?vs=73608=73688

REVISION DETAIL
  https://phabricator.kde.org/D26202

AFFECTED FILES
  autotests/kconfig_compiler/kconfigcompiler_test.cpp
  autotests/kconfig_compiler/test1.h.ref
  autotests/kconfig_compiler/test10.h.ref
  autotests/kconfig_compiler/test11.h.ref
  autotests/kconfig_compiler/test11a.h.ref
  autotests/kconfig_compiler/test12.h.ref
  autotests/kconfig_compiler/test13.h.ref
  autotests/kconfig_compiler/test9.h.ref
  autotests/kconfig_compiler/test_dpointer.cpp.ref
  autotests/kconfig_compiler/test_translation_kde.h.ref
  autotests/kconfig_compiler/test_translation_kde_domain.h.ref
  autotests/kconfig_compiler/test_translation_qt.h.ref
  autotests/kconfigtest.h
  src/kconfig_compiler/CMakeLists.txt
  src/kconfig_compiler/KCFGXmlParser.cpp
  src/kconfig_compiler/KCFGXmlParser.h
  src/kconfig_compiler/KConfigCodeGeneratorBase.cpp
  src/kconfig_compiler/KConfigCodeGeneratorBase.h
  src/kconfig_compiler/KConfigCommonStructs.h
  src/kconfig_compiler/KConfigHeaderGenerator.cpp
  src/kconfig_compiler/KConfigHeaderGenerator.h
  src/kconfig_compiler/KConfigSourceGenerator.cpp
  src/kconfig_compiler/KConfigSourceGenerator.h
  src/kconfig_compiler/KConfigXTParameters.cpp
  src/kconfig_compiler/KConfigXTParameters.h
  src/kconfig_compiler/kconfig_compiler.cpp

To: tcanabrava, #frameworks, ervin, bport, dfaure
Cc: bport, ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2020-01-16 Thread David Faure
dfaure accepted this revision.
This revision is now accepted and ready to land.

REPOSITORY
  R237 KConfig

BRANCH
  arcpatch-D26202

REVISION DETAIL
  https://phabricator.kde.org/D26202

To: tcanabrava, #frameworks, ervin, bport, dfaure
Cc: bport, ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2020-01-15 Thread Tomaz Canabrava
tcanabrava added inline comments.

INLINE COMMENTS

> dfaure wrote in kconfigcompiler_test.cpp:129
> OK, this needs a hint for the person debugging regressions then. Something 
> like
> 
>   QVERIFY2(content == contentRef, "Failure, see foo.diff");

This is done now within the appendFileDiff function.

REPOSITORY
  R237 KConfig

REVISION DETAIL
  https://phabricator.kde.org/D26202

To: tcanabrava, #frameworks, ervin, bport, dfaure
Cc: bport, ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2020-01-15 Thread Tomaz Canabrava
tcanabrava marked an inline comment as done.

REPOSITORY
  R237 KConfig

REVISION DETAIL
  https://phabricator.kde.org/D26202

To: tcanabrava, #frameworks, ervin, bport, dfaure
Cc: bport, ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2020-01-15 Thread Tomaz Canabrava
tcanabrava updated this revision to Diff 73608.
tcanabrava added a comment.


  - Rebase

REPOSITORY
  R237 KConfig

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D26202?vs=73557=73608

BRANCH
  arcpatch-D26202

REVISION DETAIL
  https://phabricator.kde.org/D26202

AFFECTED FILES
  autotests/kconfig_compiler/kconfigcompiler_test.cpp
  autotests/kconfig_compiler/test1.h.ref
  autotests/kconfig_compiler/test10.h.ref
  autotests/kconfig_compiler/test11.h.ref
  autotests/kconfig_compiler/test11a.h.ref
  autotests/kconfig_compiler/test12.h.ref
  autotests/kconfig_compiler/test13.h.ref
  autotests/kconfig_compiler/test9.h.ref
  autotests/kconfig_compiler/test_dpointer.cpp.ref
  autotests/kconfig_compiler/test_translation_kde.h.ref
  autotests/kconfig_compiler/test_translation_kde_domain.h.ref
  autotests/kconfig_compiler/test_translation_qt.h.ref
  autotests/kconfigtest.h
  src/kconfig_compiler/CMakeLists.txt
  src/kconfig_compiler/KCFGXmlParser.cpp
  src/kconfig_compiler/KCFGXmlParser.h
  src/kconfig_compiler/KConfigCodeGeneratorBase.cpp
  src/kconfig_compiler/KConfigCodeGeneratorBase.h
  src/kconfig_compiler/KConfigCommonStructs.h
  src/kconfig_compiler/KConfigHeaderGenerator.cpp
  src/kconfig_compiler/KConfigHeaderGenerator.h
  src/kconfig_compiler/KConfigSourceGenerator.cpp
  src/kconfig_compiler/KConfigSourceGenerator.h
  src/kconfig_compiler/KConfigXTParameters.cpp
  src/kconfig_compiler/KConfigXTParameters.h
  src/kconfig_compiler/kconfig_compiler.cpp

To: tcanabrava, #frameworks, ervin, bport, dfaure
Cc: bport, ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2020-01-14 Thread Tomaz Canabrava
tcanabrava updated this revision to Diff 73557.
tcanabrava added a comment.


  - Add missing copyright holders

REPOSITORY
  R237 KConfig

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D26202?vs=73510=73557

BRANCH
  arcpatch-D26202

REVISION DETAIL
  https://phabricator.kde.org/D26202

AFFECTED FILES
  autotests/kconfig_compiler/kconfigcompiler_test.cpp
  autotests/kconfig_compiler/test1.h.ref
  autotests/kconfig_compiler/test10.h.ref
  autotests/kconfig_compiler/test11.h.ref
  autotests/kconfig_compiler/test11a.h.ref
  autotests/kconfig_compiler/test12.h.ref
  autotests/kconfig_compiler/test13.h.ref
  autotests/kconfig_compiler/test9.h.ref
  autotests/kconfig_compiler/test_dpointer.cpp.ref
  autotests/kconfig_compiler/test_translation_kde.h.ref
  autotests/kconfig_compiler/test_translation_kde_domain.h.ref
  autotests/kconfig_compiler/test_translation_qt.h.ref
  autotests/kconfigtest.h
  src/kconfig_compiler/CMakeLists.txt
  src/kconfig_compiler/KCFGXmlParser.cpp
  src/kconfig_compiler/KCFGXmlParser.h
  src/kconfig_compiler/KConfigCodeGeneratorBase.cpp
  src/kconfig_compiler/KConfigCodeGeneratorBase.h
  src/kconfig_compiler/KConfigCommonStructs.h
  src/kconfig_compiler/KConfigHeaderGenerator.cpp
  src/kconfig_compiler/KConfigHeaderGenerator.h
  src/kconfig_compiler/KConfigSourceGenerator.cpp
  src/kconfig_compiler/KConfigSourceGenerator.h
  src/kconfig_compiler/KConfigXTParameters.cpp
  src/kconfig_compiler/KConfigXTParameters.h
  src/kconfig_compiler/kconfig_compiler.cpp

To: tcanabrava, #frameworks, ervin, bport, dfaure
Cc: bport, ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2020-01-14 Thread Tomaz Canabrava
tcanabrava added a comment.


  Took the time to nuke the SignalArguments and use Param instead, easier than 
I initially tougth.

INLINE COMMENTS

> dfaure wrote in kconfigcompiler_test.cpp:180
> I meant  QVERIFY2(diffFile.open(...), ...).
> No need to make a separate call to isOpen().

ups :)

REPOSITORY
  R237 KConfig

REVISION DETAIL
  https://phabricator.kde.org/D26202

To: tcanabrava, #frameworks, ervin, bport, dfaure
Cc: bport, ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2020-01-14 Thread Tomaz Canabrava
tcanabrava updated this revision to Diff 73510.
tcanabrava marked 10 inline comments as done.
tcanabrava added a comment.


  - Simplify List creation
  - Fail with the diff file name
  - Simplify Code
  - Fix Typo
  - Remove `SignalArgument` for `Param`
  - Nitpicks and Include fixes

REPOSITORY
  R237 KConfig

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D26202?vs=73345=73510

BRANCH
  arcpatch-D26202

REVISION DETAIL
  https://phabricator.kde.org/D26202

AFFECTED FILES
  autotests/kconfig_compiler/kconfigcompiler_test.cpp
  autotests/kconfig_compiler/test1.h.ref
  autotests/kconfig_compiler/test10.h.ref
  autotests/kconfig_compiler/test11.h.ref
  autotests/kconfig_compiler/test11a.h.ref
  autotests/kconfig_compiler/test12.h.ref
  autotests/kconfig_compiler/test13.h.ref
  autotests/kconfig_compiler/test9.h.ref
  autotests/kconfig_compiler/test_dpointer.cpp.ref
  autotests/kconfig_compiler/test_translation_kde.h.ref
  autotests/kconfig_compiler/test_translation_kde_domain.h.ref
  autotests/kconfig_compiler/test_translation_qt.h.ref
  autotests/kconfigtest.h
  src/kconfig_compiler/CMakeLists.txt
  src/kconfig_compiler/KCFGXmlParser.cpp
  src/kconfig_compiler/KCFGXmlParser.h
  src/kconfig_compiler/KConfigCodeGeneratorBase.cpp
  src/kconfig_compiler/KConfigCodeGeneratorBase.h
  src/kconfig_compiler/KConfigCommonStructs.h
  src/kconfig_compiler/KConfigHeaderGenerator.cpp
  src/kconfig_compiler/KConfigHeaderGenerator.h
  src/kconfig_compiler/KConfigSourceGenerator.cpp
  src/kconfig_compiler/KConfigSourceGenerator.h
  src/kconfig_compiler/KConfigXTParameters.cpp
  src/kconfig_compiler/KConfigXTParameters.h
  src/kconfig_compiler/kconfig_compiler.cpp

To: tcanabrava, #frameworks, ervin, bport, dfaure
Cc: bport, ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2020-01-13 Thread David Faure
dfaure requested changes to this revision.
dfaure added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> tcanabrava wrote in kconfigcompiler_test.cpp:129
> the text was really not friendly, it was a big blob of diff content pasted on 
> screen. Considering that the next line will also fail I replaced this by 
> saving the diff file on disk, this way we can actually look at the file that 
> failed and take the time to understand the error.

OK, this needs a hint for the person debugging regressions then. Something like

  QVERIFY2(content == contentRef, "Failure, see foo.diff");

> dfaure wrote in kconfigcompiler_test.cpp:180
> QVERIFY(...)

I meant  QVERIFY2(diffFile.open(...), ...).
No need to make a separate call to isOpen().

> KCFGXmlParser.h:47
> +private:
> +// creates a `somethignChanged` signal for every property
> +void createChangedSignal(CfgEntry );

typo ("something")

> KConfigCodeGeneratorBase.cpp:2
> +/* This file is part of the KDE libraries
> +Copyright (C) 2020 Tomaz Cananbrava (tcanabr...@kde.org)
> +

Is this really entirely new code?

Please propagate the copyright of the file you copied this from.

I can agree that .h files are brand new, but not .cpp files

> tcanabrava wrote in KConfigCommonStructs.h:14
> No, there's a struct SignalArguments and a struct Param that are  basically 
> the same thing. A name and a Type. Still in the TODO.

Oh. I thought it meant "remove SignalArguments members from Param".

Can you at least clarify the comment by saying "TODO merge Param and 
SignalArguments" or (in front of SignalArguments) "TODO use Param instead"?

> tcanabrava wrote in KConfigHeaderGenerator.h:73
> Kate / KDevelop here. I'm manually adding them.

I'm no expert but I'm sure there's an option for this somewhere

> KConfigSourceGenerator.cpp:59
> +{
> +qDebug() << "Source Includes" << cfg.sourceIncludes;
> +

There are still some qDebugs, please do a patch-wide search.

> KConfigSourceGenerator.cpp:224
> +if (parseResult.cfgFileNameArg) {
> +if (! cfg.forceStringFilename) {
> +stream << " KSharedConfig::Ptr config";

no space after '!'

> KConfigSourceGenerator.cpp:391
> +}
> +void KConfigSourceGenerator::doConstructor() {
> +

newline before '{'

> kconfig_compiler.cpp:762
> +const QString baseName = inputFilename.mid(0, inputFilename.size()-5);
> +qDebug() << "Base name calculed" << baseName;
>  

^

REPOSITORY
  R237 KConfig

REVISION DETAIL
  https://phabricator.kde.org/D26202

To: tcanabrava, #frameworks, ervin, bport, dfaure
Cc: bport, ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2020-01-12 Thread Tomaz Canabrava
tcanabrava added a comment.


  @dfaure , @ervin
  
  Right now the code passes all the tests and I tried to be extra careful not 
to break away with the general architecture. I think it's the first "safe" 
version to review.

REPOSITORY
  R237 KConfig

REVISION DETAIL
  https://phabricator.kde.org/D26202

To: tcanabrava, #frameworks, ervin, bport, dfaure
Cc: bport, ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2020-01-12 Thread Tomaz Canabrava
tcanabrava updated this revision to Diff 73345.
tcanabrava added a comment.


  - Fix bug ediging param variable that's supposed to be const
  - Const Correctness:

REPOSITORY
  R237 KConfig

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D26202?vs=73336=73345

BRANCH
  arcpatch-D26202

REVISION DETAIL
  https://phabricator.kde.org/D26202

AFFECTED FILES
  autotests/kconfig_compiler/kconfigcompiler_test.cpp
  autotests/kconfig_compiler/test1.h.ref
  autotests/kconfig_compiler/test10.h.ref
  autotests/kconfig_compiler/test11.h.ref
  autotests/kconfig_compiler/test11a.h.ref
  autotests/kconfig_compiler/test12.h.ref
  autotests/kconfig_compiler/test13.h.ref
  autotests/kconfig_compiler/test9.h.ref
  autotests/kconfig_compiler/test_dpointer.cpp.ref
  autotests/kconfig_compiler/test_translation_kde.h.ref
  autotests/kconfig_compiler/test_translation_kde_domain.h.ref
  autotests/kconfig_compiler/test_translation_qt.h.ref
  autotests/kconfigtest.h
  src/kconfig_compiler/CMakeLists.txt
  src/kconfig_compiler/KCFGXmlParser.cpp
  src/kconfig_compiler/KCFGXmlParser.h
  src/kconfig_compiler/KConfigCodeGeneratorBase.cpp
  src/kconfig_compiler/KConfigCodeGeneratorBase.h
  src/kconfig_compiler/KConfigCommonStructs.h
  src/kconfig_compiler/KConfigHeaderGenerator.cpp
  src/kconfig_compiler/KConfigHeaderGenerator.h
  src/kconfig_compiler/KConfigSourceGenerator.cpp
  src/kconfig_compiler/KConfigSourceGenerator.h
  src/kconfig_compiler/KConfigXTParameters.cpp
  src/kconfig_compiler/KConfigXTParameters.h
  src/kconfig_compiler/kconfig_compiler.cpp

To: tcanabrava, #frameworks, ervin, bport, dfaure
Cc: bport, ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2020-01-12 Thread Tomaz Canabrava
tcanabrava marked 8 inline comments as done.

REPOSITORY
  R237 KConfig

REVISION DETAIL
  https://phabricator.kde.org/D26202

To: tcanabrava, #frameworks, ervin, bport, dfaure
Cc: bport, ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2020-01-12 Thread Tomaz Canabrava
tcanabrava added inline comments.

INLINE COMMENTS

> tcanabrava wrote in kconfig_compiler.cpp:753
> that was a bit harder than I want, but done. Inside of the code generation 
> there was code that manipulated the ParseResult. I think this is one of the 
> good spots that show that this rewrite is really needed.

aand no, this introduced regressions, I'll try to solve it later but it's 
not as simple. this will unfortunately still be modified inside of the 
generator files. :/

REPOSITORY
  R237 KConfig

REVISION DETAIL
  https://phabricator.kde.org/D26202

To: tcanabrava, #frameworks, ervin, bport, dfaure
Cc: bport, ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2020-01-12 Thread Tomaz Canabrava
tcanabrava updated this revision to Diff 73336.
tcanabrava marked 4 inline comments as done.
tcanabrava added a comment.


  - Rename KConfigCodeGenerator to KconfigCodeGeneratorBase
  - Simplify diff file saving
  - Add License Headers
  - Documentation, Privatization, Unused method / variable
  - Const, Documentation
  - Newlines at the end of files
  - Spacing
  - Remove Globals
  - Remove unused code and Debugs
  - Constify ParseResult
  - English Typos
  - qAsConst
  - Public / Private issues
  - Simplify Construction
  - Revert "Constify ParseResult"

REPOSITORY
  R237 KConfig

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D26202?vs=73310=73336

BRANCH
  arcpatch-D26202

REVISION DETAIL
  https://phabricator.kde.org/D26202

AFFECTED FILES
  autotests/kconfig_compiler/kconfigcompiler_test.cpp
  autotests/kconfig_compiler/test1.h.ref
  autotests/kconfig_compiler/test10.h.ref
  autotests/kconfig_compiler/test11.h.ref
  autotests/kconfig_compiler/test11a.h.ref
  autotests/kconfig_compiler/test12.h.ref
  autotests/kconfig_compiler/test13.h.ref
  autotests/kconfig_compiler/test9.h.ref
  autotests/kconfig_compiler/test_dpointer.cpp.ref
  autotests/kconfig_compiler/test_translation_kde.h.ref
  autotests/kconfig_compiler/test_translation_kde_domain.h.ref
  autotests/kconfig_compiler/test_translation_qt.h.ref
  autotests/kconfigtest.h
  src/kconfig_compiler/CMakeLists.txt
  src/kconfig_compiler/KCFGXmlParser.cpp
  src/kconfig_compiler/KCFGXmlParser.h
  src/kconfig_compiler/KConfigCodeGeneratorBase.cpp
  src/kconfig_compiler/KConfigCodeGeneratorBase.h
  src/kconfig_compiler/KConfigCommonStructs.h
  src/kconfig_compiler/KConfigHeaderGenerator.cpp
  src/kconfig_compiler/KConfigHeaderGenerator.h
  src/kconfig_compiler/KConfigSourceGenerator.cpp
  src/kconfig_compiler/KConfigSourceGenerator.h
  src/kconfig_compiler/KConfigXTParameters.cpp
  src/kconfig_compiler/KConfigXTParameters.h
  src/kconfig_compiler/kconfig_compiler.cpp

To: tcanabrava, #frameworks, ervin, bport, dfaure
Cc: bport, ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2020-01-12 Thread Tomaz Canabrava
tcanabrava marked 22 inline comments as done.
tcanabrava added inline comments.

INLINE COMMENTS

> dfaure wrote in kconfigcompiler_test.cpp:129
> Why did you remove this? It's just a more user-friendly version of the 
> QVERIFY on the next line, so it can't possibly have failed while the next 
> line passes...

the text was really not friendly, it was a big blob of diff content pasted on 
screen. Considering that the next line will also fail I replaced this by saving 
the diff file on disk, this way we can actually look at the file that failed 
and take the time to understand the error.

> dfaure wrote in KConfigCodeGenerator.h:91
> urgh, a public variable

that was a honest mistake :)

> dfaure wrote in KConfigCommonStructs.h:14
> done already?

No, there's a struct SignalArguments and a struct Param that are  basically the 
same thing. A name and a Type. Still in the TODO.

> dfaure wrote in KConfigHeaderGenerator.h:73
> I thought most editors took care of that, these days...

Kate / KDevelop here. I'm manually adding them.

> dfaure wrote in KConfigSourceGenerator.cpp:40
> remove (or switch to qCDebug)

removed, those are temporaries debug calls that I used to be sure things are as 
supposed.

> dfaure wrote in kconfig_compiler.cpp:753
> const ... ?

that was a bit harder than I want, but done. Inside of the code generation 
there was code that manipulated the ParseResult. I think this is one of the 
good spots that show that this rewrite is really needed.

REPOSITORY
  R237 KConfig

REVISION DETAIL
  https://phabricator.kde.org/D26202

To: tcanabrava, #frameworks, ervin, bport, dfaure
Cc: bport, ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2020-01-12 Thread David Faure
dfaure requested changes to this revision.
dfaure added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> kconfigcompiler_test.cpp:129
> -// use split('\n') to avoid
> -// the whole output shown inline
> -QCOMPARE(content.split('\n'), contentRef.split('\n'));

Why did you remove this? It's just a more user-friendly version of the QVERIFY 
on the next line, so it can't possibly have failed while the next line passes...

> kconfigcompiler_test.cpp:180
> +QFile diffFile(oldFile + QStringLiteral(".diff"));
> +diffFile.open(QIODevice::WriteOnly);
> +

QVERIFY(...)

> kconfigcompiler_test.cpp:183
> +QTextStream writer();
> +writer << out;
> +diffFile.close();

diffFile.write(out); would be simpler than going via QTextStream

> kconfigcompiler_test.cpp:184
> +writer << out;
> +diffFile.close();
>  }

not needed, the dtor closes

> KCFGXmlParser.cpp:20
> +
> +// TODO: Remove those global.
> +extern QStringList allNames;

Yes ;)

> KCFGXmlParser.h:1
> +#ifndef KCFGXMLPARSER_H
> +#define KCFGXMLPARSER_H

missing license header

(repeats)

> KCFGXmlParser.h:15
> +void start();
> +QString errorString();
> +ParseResult getParseResult();

... const;

> KCFGXmlParser.h:16
> +QString errorString();
> +ParseResult getParseResult();
> +

... const;

> KCFGXmlParser.h:28
> +// Those are the Entries in the Xml, that represent a parameter within 
> the   tag.
> +void readParameterFromEntry(CfgEntry , const QDomElement );
> +bool hasDefaultCode(CfgEntry , const QDomElement );

(to pick on one random method as an example) : this is only used internally by 
the class, it should be made private. Please do this for all methods that are 
not used from outside the class. It will make it much clearer what's the actual 
API of the class.

> KCFGXmlParser.h:34
> +
> +// TODO: Fix this function later.
> +CfgEntry *parseEntry(const QString , const QDomElement );

how, why, when?

> KCFGXmlParser.h:45
> +#endif
> \ No newline at end of file


should be fixed

> KConfigCodeGenerator.h:34
> +
> +/* This class manages the base of writting a C - Based code */
> +class KConfigCodeGenerator {

writing takes a single 't'

> KConfigCodeGenerator.h:35
> +/* This class manages the base of writting a C - Based code */
> +class KConfigCodeGenerator {
> +public:

Maybe call it KConfigCodeGeneratorBase ?

It wasn't obvious to me initially that it was "just" a base class.

> KConfigCodeGenerator.h:37
> +public:
> +enum ScopeFinalizer {None, Semicollon};
> +

Semicolon takes a single 'l'

> KConfigCodeGenerator.h:91
> +
> +public:
> +int indentLevel = 0;

urgh, a public variable

> KConfigCommonStructs.h:14
> +
> +// TODO: Remove Signal Arguments for `Param`
> +struct Param

done already?

> KConfigHeaderGenerator.cpp:52
> +
> +for (auto *entry : parseResult.entries) {
> +const QString n = entry->name;

qAsConst()

> KConfigHeaderGenerator.cpp:140
> +stream << endl;
> +// HACK: Original files ended with two last spaces, add them.
> +stream << endl;

s/spaces/newlines/

> KConfigHeaderGenerator.cpp:214
> +{
> +
> +}

nothing here?

> KConfigHeaderGenerator.h:73
> +#endif
> \ No newline at end of file


I thought most editors took care of that, these days...

> KConfigSourceGenerator.cpp:40
> +{
> +qDebug() << "Source Includes" << cfg.sourceIncludes;
> +

remove (or switch to qCDebug)

> KConfigSourceGenerator.h:46
> +
> +// Those are fairly self contained functions.
> +void createHeaders();

Do they all need to be public?

> kconfig_compiler.cpp:745
>  
> -if (!codegenFilename.endsWith(QLatin1String(".kcfgc"))) {
> -cerr << "Codegen options file must have extension .kcfgc" << endl;
> -return 1;
> -}
> -QString baseName = QFileInfo(codegenFilename).fileName();
> -baseName = baseName.left(baseName.length() - 6);
> +KConfigXTParameters cfg = KConfigXTParameters(codegenFilename);
>  

it's shorter and simpler to write KConfigXTParameters cfg(codegenFilename);

> kconfig_compiler.cpp:753
>  
> -QFile input(inputFilename);
> +ParseResult parseResult = xmlParser.getParseResult();
>  

const ... ?

REPOSITORY
  R237 KConfig

REVISION DETAIL
  https://phabricator.kde.org/D26202

To: tcanabrava, #frameworks, ervin, bport, dfaure
Cc: bport, ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2020-01-11 Thread Tomaz Canabrava
tcanabrava added a comment.


  Looking at the review you it's a bis strange to see that I'v touched some 
test reference generated code, I did this only on *whitespace only changes* 
where the new whitespace made more sense than the old one.
  there is *one* bug I havent fixed on this code that I plan to fix tomorrow, 
as it's almost 9:45 and it's saturday. I believe that this code is getting near 
review quality.
  I'v also rebased against master as some other people also started to change 
this code - I already got a few conflicts, so I really need to rush this before 
it gets unmergeable.

REPOSITORY
  R237 KConfig

REVISION DETAIL
  https://phabricator.kde.org/D26202

To: tcanabrava, #frameworks, ervin, bport, dfaure
Cc: bport, ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2020-01-11 Thread Tomaz Canabrava
tcanabrava updated this revision to Diff 73310.
tcanabrava added a comment.


  - Fix whitespace on the reference code / genreator

REPOSITORY
  R237 KConfig

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D26202?vs=73301=73310

BRANCH
  arcpatch-D26202

REVISION DETAIL
  https://phabricator.kde.org/D26202

AFFECTED FILES
  autotests/kconfig_compiler/kconfigcompiler_test.cpp
  autotests/kconfig_compiler/test1.h.ref
  autotests/kconfig_compiler/test10.h.ref
  autotests/kconfig_compiler/test11.h.ref
  autotests/kconfig_compiler/test11a.h.ref
  autotests/kconfig_compiler/test12.h.ref
  autotests/kconfig_compiler/test13.h.ref
  autotests/kconfig_compiler/test9.h.ref
  autotests/kconfig_compiler/test_dpointer.cpp.ref
  autotests/kconfig_compiler/test_translation_kde.h.ref
  autotests/kconfig_compiler/test_translation_kde_domain.h.ref
  autotests/kconfig_compiler/test_translation_qt.h.ref
  src/kconfig_compiler/CMakeLists.txt
  src/kconfig_compiler/KCFGXmlParser.cpp
  src/kconfig_compiler/KCFGXmlParser.h
  src/kconfig_compiler/KConfigCodeGenerator.cpp
  src/kconfig_compiler/KConfigCodeGenerator.h
  src/kconfig_compiler/KConfigCommonStructs.h
  src/kconfig_compiler/KConfigHeaderGenerator.cpp
  src/kconfig_compiler/KConfigHeaderGenerator.h
  src/kconfig_compiler/KConfigSourceGenerator.cpp
  src/kconfig_compiler/KConfigSourceGenerator.h
  src/kconfig_compiler/KConfigXTParameters.cpp
  src/kconfig_compiler/KConfigXTParameters.h
  src/kconfig_compiler/kconfig_compiler.cpp

To: tcanabrava, #frameworks, ervin, bport, dfaure
Cc: bport, ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2020-01-11 Thread Tomaz Canabrava
tcanabrava updated this revision to Diff 73301.
tcanabrava added a comment.


  - More whiteespaces fixed
  - Fix *space only* issues with the  test reference headers
  - More whitespace fixes, only six files to go
  - Way more tests passing - space fixes

REPOSITORY
  R237 KConfig

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D26202?vs=73292=73301

BRANCH
  arcpatch-D26202

REVISION DETAIL
  https://phabricator.kde.org/D26202

AFFECTED FILES
  autotests/kconfig_compiler/kconfigcompiler_test.cpp
  autotests/kconfig_compiler/test1.h.ref
  autotests/kconfig_compiler/test10.h.ref
  autotests/kconfig_compiler/test11.h.ref
  autotests/kconfig_compiler/test11a.h.ref
  autotests/kconfig_compiler/test12.h.ref
  autotests/kconfig_compiler/test13.h.ref
  autotests/kconfig_compiler/test9.h.ref
  autotests/kconfig_compiler/test_translation_kde.h.ref
  autotests/kconfig_compiler/test_translation_kde_domain.h.ref
  autotests/kconfig_compiler/test_translation_qt.h.ref
  src/kconfig_compiler/CMakeLists.txt
  src/kconfig_compiler/KCFGXmlParser.cpp
  src/kconfig_compiler/KCFGXmlParser.h
  src/kconfig_compiler/KConfigCodeGenerator.cpp
  src/kconfig_compiler/KConfigCodeGenerator.h
  src/kconfig_compiler/KConfigCommonStructs.h
  src/kconfig_compiler/KConfigHeaderGenerator.cpp
  src/kconfig_compiler/KConfigHeaderGenerator.h
  src/kconfig_compiler/KConfigSourceGenerator.cpp
  src/kconfig_compiler/KConfigSourceGenerator.h
  src/kconfig_compiler/KConfigXTParameters.cpp
  src/kconfig_compiler/KConfigXTParameters.h
  src/kconfig_compiler/kconfig_compiler.cpp

To: tcanabrava, #frameworks, ervin, bport, dfaure
Cc: bport, ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2020-01-11 Thread Tomaz Canabrava
tcanabrava updated this revision to Diff 73292.
tcanabrava added a comment.


  - Fix many small whitespace issues

REPOSITORY
  R237 KConfig

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D26202?vs=73290=73292

BRANCH
  arcpatch-D26202

REVISION DETAIL
  https://phabricator.kde.org/D26202

AFFECTED FILES
  autotests/kconfig_compiler/kconfigcompiler_test.cpp
  autotests/kconfig_compiler/test1.h.ref
  autotests/kconfig_compiler/test10.h.ref
  autotests/kconfig_compiler/test11.h.ref
  src/kconfig_compiler/CMakeLists.txt
  src/kconfig_compiler/KCFGXmlParser.cpp
  src/kconfig_compiler/KCFGXmlParser.h
  src/kconfig_compiler/KConfigCodeGenerator.cpp
  src/kconfig_compiler/KConfigCodeGenerator.h
  src/kconfig_compiler/KConfigCommonStructs.h
  src/kconfig_compiler/KConfigHeaderGenerator.cpp
  src/kconfig_compiler/KConfigHeaderGenerator.h
  src/kconfig_compiler/KConfigSourceGenerator.cpp
  src/kconfig_compiler/KConfigSourceGenerator.h
  src/kconfig_compiler/KConfigXTParameters.cpp
  src/kconfig_compiler/KConfigXTParameters.h
  src/kconfig_compiler/kconfig_compiler.cpp

To: tcanabrava, #frameworks, ervin, bport, dfaure
Cc: bport, ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2020-01-11 Thread Tomaz Canabrava
tcanabrava updated this revision to Diff 73290.
tcanabrava added a comment.


  - Rebase on master

REPOSITORY
  R237 KConfig

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D26202?vs=72715=73290

BRANCH
  arcpatch-D26202

REVISION DETAIL
  https://phabricator.kde.org/D26202

AFFECTED FILES
  autotests/kconfig_compiler/kconfigcompiler_test.cpp
  src/kconfig_compiler/CMakeLists.txt
  src/kconfig_compiler/KCFGXmlParser.cpp
  src/kconfig_compiler/KCFGXmlParser.h
  src/kconfig_compiler/KConfigCodeGenerator.cpp
  src/kconfig_compiler/KConfigCodeGenerator.h
  src/kconfig_compiler/KConfigCommonStructs.h
  src/kconfig_compiler/KConfigHeaderGenerator.cpp
  src/kconfig_compiler/KConfigHeaderGenerator.h
  src/kconfig_compiler/KConfigSourceGenerator.cpp
  src/kconfig_compiler/KConfigSourceGenerator.h
  src/kconfig_compiler/KConfigXTParameters.cpp
  src/kconfig_compiler/KConfigXTParameters.h
  src/kconfig_compiler/kconfig_compiler.cpp

To: tcanabrava, #frameworks, ervin, bport, dfaure
Cc: bport, ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2020-01-03 Thread Tomaz Canabrava
tcanabrava updated this revision to Diff 72715.
tcanabrava edited the test plan for this revision.
tcanabrava added a comment.


  - Add Hack for Enums
  - Fix Whitespace diff
  - Move some raw scopes to start/end scope()

REPOSITORY
  R237 KConfig

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D26202?vs=72711=72715

BRANCH
  arcpatch-D26202

REVISION DETAIL
  https://phabricator.kde.org/D26202

AFFECTED FILES
  autotests/kconfig_compiler/kconfigcompiler_test.cpp
  src/kconfig_compiler/CMakeLists.txt
  src/kconfig_compiler/KCFGXmlParser.cpp
  src/kconfig_compiler/KCFGXmlParser.h
  src/kconfig_compiler/KConfigCodeGenerator.cpp
  src/kconfig_compiler/KConfigCodeGenerator.h
  src/kconfig_compiler/KConfigCommonStructs.h
  src/kconfig_compiler/KConfigHeaderGenerator.cpp
  src/kconfig_compiler/KConfigHeaderGenerator.h
  src/kconfig_compiler/KConfigSourceGenerator.cpp
  src/kconfig_compiler/KConfigSourceGenerator.h
  src/kconfig_compiler/KConfigXTParameters.cpp
  src/kconfig_compiler/KConfigXTParameters.h
  src/kconfig_compiler/kconfig_compiler.cpp

To: tcanabrava, #frameworks, ervin, bport, dfaure
Cc: bport, ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2020-01-03 Thread Tomaz Canabrava
tcanabrava edited the summary of this revision.
tcanabrava edited the test plan for this revision.

REPOSITORY
  R237 KConfig

REVISION DETAIL
  https://phabricator.kde.org/D26202

To: tcanabrava, #frameworks, ervin, bport, dfaure
Cc: bport, ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2020-01-03 Thread Tomaz Canabrava
tcanabrava updated this revision to Diff 72711.
tcanabrava added a comment.


  - Add missing .h
  - Fixes placement of code
  - Change how tests save tests
  - Change how the Indentation is done
  - Fix filename in the preamble
  - Separate logic to make function readable
  - Fix more newlines
  - Add Hacks around code to generate the same amount of Empty Space

REPOSITORY
  R237 KConfig

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D26202?vs=72377=72711

BRANCH
  arcpatch-D26202

REVISION DETAIL
  https://phabricator.kde.org/D26202

AFFECTED FILES
  autotests/kconfig_compiler/kconfigcompiler_test.cpp
  src/kconfig_compiler/CMakeLists.txt
  src/kconfig_compiler/KCFGXmlParser.cpp
  src/kconfig_compiler/KCFGXmlParser.h
  src/kconfig_compiler/KConfigCodeGenerator.cpp
  src/kconfig_compiler/KConfigCodeGenerator.h
  src/kconfig_compiler/KConfigCommonStructs.h
  src/kconfig_compiler/KConfigHeaderGenerator.cpp
  src/kconfig_compiler/KConfigHeaderGenerator.h
  src/kconfig_compiler/KConfigSourceGenerator.cpp
  src/kconfig_compiler/KConfigSourceGenerator.h
  src/kconfig_compiler/KConfigXTParameters.cpp
  src/kconfig_compiler/KConfigXTParameters.h
  src/kconfig_compiler/kconfig_compiler.cpp

To: tcanabrava, #frameworks, ervin, bport, dfaure
Cc: bport, ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2019-12-31 Thread David Faure
dfaure added a reviewer: dfaure.

REPOSITORY
  R237 KConfig

REVISION DETAIL
  https://phabricator.kde.org/D26202

To: tcanabrava, #frameworks, ervin, bport, dfaure
Cc: bport, ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2019-12-30 Thread Tomaz Canabrava
tcanabrava added a subscriber: bport.
tcanabrava added a comment.


  Not really as all the calls are the same, just split into classes and
  logical bits. I haven’t write a single line of logic.

REPOSITORY
  R237 KConfig

REVISION DETAIL
  https://phabricator.kde.org/D26202

To: tcanabrava, #frameworks, ervin, bport
Cc: bport, ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


Re: D26202: WIP: Refactor KConfigXT

2019-12-30 Thread Tomaz Canabrava
Not really as all the calls are the same, just split into classes and
logical bits. I haven’t write a single line of logic.

On Mon, 30 Dec 2019 at 19:00 Nathaniel Graham 
wrote:

> ngraham added a comment. View Revision
> 
>
> At this point, it seems more like a total rewrite than a refactor...
>
> *REPOSITORY*
> R237 KConfig
>
> *REVISION DETAIL*
> https://phabricator.kde.org/D26202
>
> *To: *tcanabrava, Frameworks, ervin, bport
> *Cc: *ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns
>


D26202: WIP: Refactor KConfigXT

2019-12-30 Thread Nathaniel Graham
ngraham added a comment.


  At this point, it seems more like a total rewrite than a refactor...

REPOSITORY
  R237 KConfig

REVISION DETAIL
  https://phabricator.kde.org/D26202

To: tcanabrava, #frameworks, ervin, bport
Cc: ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2019-12-30 Thread Tomaz Canabrava
tcanabrava updated this revision to Diff 72377.
tcanabrava added a comment.


  - Reorganize code
  - Fix filename
  - Fix Static Methods
  - Fix name generation
  - Call forgotten function in the right place
  - Fix signal generation - remove stray bit of code

REPOSITORY
  R237 KConfig

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D26202?vs=72371=72377

BRANCH
  arcpatch-D26202

REVISION DETAIL
  https://phabricator.kde.org/D26202

AFFECTED FILES
  src/kconfig_compiler/CMakeLists.txt
  src/kconfig_compiler/KCFGXmlParser.cpp
  src/kconfig_compiler/KCFGXmlParser.h
  src/kconfig_compiler/KConfigCodeGenerator.cpp
  src/kconfig_compiler/KConfigCodeGenerator.h
  src/kconfig_compiler/KConfigCommonStructs.h
  src/kconfig_compiler/KConfigHeaderGenerator.cpp
  src/kconfig_compiler/KConfigHeaderGenerator.h
  src/kconfig_compiler/KConfigSourceGenerator.cpp
  src/kconfig_compiler/KConfigSourceGenerator.h
  src/kconfig_compiler/KConfigXTParameters.cpp
  src/kconfig_compiler/KConfigXTParameters.h
  src/kconfig_compiler/kconfig_compiler.cpp

To: tcanabrava, #frameworks, ervin, bport
Cc: ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2019-12-30 Thread Tomaz Canabrava
tcanabrava updated this revision to Diff 72371.
tcanabrava added a comment.


  - Regression: Remove space from the autogen preamble
  - Whitespace regression
  - Fix hasNamespace: logic was inverted
  - Space issues and scope
  - Use whitespace() function to manage indentation level
  - Space fixes and minor nitpicks

REPOSITORY
  R237 KConfig

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D26202?vs=72349=72371

BRANCH
  arcpatch-D26202

REVISION DETAIL
  https://phabricator.kde.org/D26202

AFFECTED FILES
  src/kconfig_compiler/CMakeLists.txt
  src/kconfig_compiler/KCFGXmlParser.cpp
  src/kconfig_compiler/KCFGXmlParser.h
  src/kconfig_compiler/KConfigCodeGenerator.cpp
  src/kconfig_compiler/KConfigCodeGenerator.h
  src/kconfig_compiler/KConfigCommonStructs.h
  src/kconfig_compiler/KConfigHeaderGenerator.cpp
  src/kconfig_compiler/KConfigHeaderGenerator.h
  src/kconfig_compiler/KConfigSourceGenerator.cpp
  src/kconfig_compiler/KConfigSourceGenerator.h
  src/kconfig_compiler/KConfigXTParameters.cpp
  src/kconfig_compiler/KConfigXTParameters.h
  src/kconfig_compiler/kconfig_compiler.cpp

To: tcanabrava, #frameworks, ervin, bport
Cc: ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2019-12-29 Thread Tomaz Canabrava
tcanabrava updated this revision to Diff 72349.
tcanabrava added a comment.


  - Fix some obvious bugs.

REPOSITORY
  R237 KConfig

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D26202?vs=72338=72349

BRANCH
  megaRefactor

REVISION DETAIL
  https://phabricator.kde.org/D26202

AFFECTED FILES
  src/kconfig_compiler/CMakeLists.txt
  src/kconfig_compiler/KCFGXmlParser.cpp
  src/kconfig_compiler/KCFGXmlParser.h
  src/kconfig_compiler/KConfigCodeGenerator.cpp
  src/kconfig_compiler/KConfigCodeGenerator.h
  src/kconfig_compiler/KConfigCommonStructs.h
  src/kconfig_compiler/KConfigHeaderGenerator.cpp
  src/kconfig_compiler/KConfigHeaderGenerator.h
  src/kconfig_compiler/KConfigSourceGenerator.cpp
  src/kconfig_compiler/KConfigSourceGenerator.h
  src/kconfig_compiler/KConfigXTParameters.cpp
  src/kconfig_compiler/KConfigXTParameters.h
  src/kconfig_compiler/kconfig_compiler.cpp

To: tcanabrava, #frameworks, ervin, bport
Cc: ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2019-12-29 Thread Tomaz Canabrava
tcanabrava edited the summary of this revision.

REPOSITORY
  R237 KConfig

REVISION DETAIL
  https://phabricator.kde.org/D26202

To: tcanabrava, #frameworks, ervin, bport
Cc: ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2019-12-29 Thread Tomaz Canabrava
tcanabrava edited the summary of this revision.

REPOSITORY
  R237 KConfig

REVISION DETAIL
  https://phabricator.kde.org/D26202

To: tcanabrava, #frameworks, ervin, bport
Cc: ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2019-12-29 Thread Nathaniel Graham
ngraham added reviewers: Frameworks, ervin, bport.
ngraham added a comment.


  That explanation really belongs in the Description section of this patch, not 
in a comment. :)

REPOSITORY
  R237 KConfig

REVISION DETAIL
  https://phabricator.kde.org/D26202

To: tcanabrava, #frameworks, ervin, bport
Cc: ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2019-12-29 Thread Tomaz Canabrava
tcanabrava updated this revision to Diff 72338.
tcanabrava added a comment.


  - Move XmlParser to another file.
  - Move Code around again
  - Fix some issues - still broken
  - Move Parser to own file
  - Move a lot of code to the Parser Class
  - Fix a few of the many many warnings.

REPOSITORY
  R237 KConfig

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D26202?vs=72326=72338

BRANCH
  megaRefactor

REVISION DETAIL
  https://phabricator.kde.org/D26202

AFFECTED FILES
  src/kconfig_compiler/CMakeLists.txt
  src/kconfig_compiler/KCFGXmlParser.cpp
  src/kconfig_compiler/KCFGXmlParser.h
  src/kconfig_compiler/KConfigCodeGenerator.cpp
  src/kconfig_compiler/KConfigCodeGenerator.h
  src/kconfig_compiler/KConfigCommonStructs.h
  src/kconfig_compiler/KConfigHeaderGenerator.cpp
  src/kconfig_compiler/KConfigHeaderGenerator.h
  src/kconfig_compiler/KConfigSourceGenerator.cpp
  src/kconfig_compiler/KConfigSourceGenerator.h
  src/kconfig_compiler/KConfigXTParameters.cpp
  src/kconfig_compiler/KConfigXTParameters.h
  src/kconfig_compiler/kconfig_compiler.cpp

To: tcanabrava
Cc: ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2019-12-29 Thread Tomaz Canabrava
tcanabrava updated this revision to Diff 72326.
tcanabrava added a comment.


  - Add new Class, KConfigSourceGenerator, fix usage of addHeader
  - Move CreateSingletonImplementation
  - Create Cpp Preamble
  - Move Constructor implementation
  - move Getter / Setter / Destructor
  - Remove unused function
  - Move nonModifyingSignalsHelper
  - Finished Moving generator code

REPOSITORY
  R237 KConfig

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D26202?vs=72171=72326

BRANCH
  megaRefactor

REVISION DETAIL
  https://phabricator.kde.org/D26202

AFFECTED FILES
  src/kconfig_compiler/CMakeLists.txt
  src/kconfig_compiler/KConfigCodeGenerator.cpp
  src/kconfig_compiler/KConfigCodeGenerator.h
  src/kconfig_compiler/KConfigCommonStructs.h
  src/kconfig_compiler/KConfigHeaderGenerator.cpp
  src/kconfig_compiler/KConfigHeaderGenerator.h
  src/kconfig_compiler/KConfigSourceGenerator.cpp
  src/kconfig_compiler/KConfigSourceGenerator.h
  src/kconfig_compiler/KConfigXTParameters.cpp
  src/kconfig_compiler/KConfigXTParameters.h
  src/kconfig_compiler/kconfig_compiler.cpp

To: tcanabrava
Cc: ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2019-12-25 Thread Tomaz Canabrava
tcanabrava updated this revision to Diff 72171.
tcanabrava added a comment.


  - Finish header / Move basename to the ParameterConfiguration

REPOSITORY
  R237 KConfig

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D26202?vs=72166=72171

BRANCH
  megaRefactor

REVISION DETAIL
  https://phabricator.kde.org/D26202

AFFECTED FILES
  src/kconfig_compiler/CMakeLists.txt
  src/kconfig_compiler/KConfigCodeGenerator.cpp
  src/kconfig_compiler/KConfigCodeGenerator.h
  src/kconfig_compiler/KConfigCommonStructs.h
  src/kconfig_compiler/KConfigHeaderGenerator.cpp
  src/kconfig_compiler/KConfigHeaderGenerator.h
  src/kconfig_compiler/KConfigXTParameters.cpp
  src/kconfig_compiler/KConfigXTParameters.h
  src/kconfig_compiler/kconfig_compiler.cpp

To: tcanabrava
Cc: ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2019-12-25 Thread Tomaz Canabrava
tcanabrava updated this revision to Diff 72166.
tcanabrava added a comment.


  - Port more header functions
  - Move CreateItemAcessors and CreateSignals
  - Remove indentation level
  - Move NonDPointerMembers and DPointerMembers

REPOSITORY
  R237 KConfig

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D26202?vs=72126=72166

BRANCH
  megaRefactor

REVISION DETAIL
  https://phabricator.kde.org/D26202

AFFECTED FILES
  src/kconfig_compiler/CMakeLists.txt
  src/kconfig_compiler/KConfigCodeGenerator.cpp
  src/kconfig_compiler/KConfigCodeGenerator.h
  src/kconfig_compiler/KConfigCommonStructs.h
  src/kconfig_compiler/KConfigHeaderGenerator.cpp
  src/kconfig_compiler/KConfigHeaderGenerator.h
  src/kconfig_compiler/KConfigXTParameters.cpp
  src/kconfig_compiler/KConfigXTParameters.h
  src/kconfig_compiler/kconfig_compiler.cpp

To: tcanabrava
Cc: ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2019-12-24 Thread Tomaz Canabrava
tcanabrava added a comment.


  In D26202#582541 , @ngraham wrote:
  
  > > This is really a wip, completely broken. It's just so people can point me 
to the right direction.
  >
  > Maybe could you clarify which direction you want to be pointed in? What's 
the goal here? What do you need help with?
  
  
  Fair Enough:
  
  The current KConfigXT compiler is in a sad state: 
  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).
  
  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.
  
  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.
  
  - CodeGenerator: Has base code for the header and source files that can be 
shared
  - HeaderGenerator: Logic for generating the header file
  - SourceGenerator: Logic for generating the source file
  - KcfgParser: Logic for parsing the kcfg file and extracting the information
  - CommonStructs: a header that contains the structs that are currently used 
everywhere.
  - KConfigParameters: (was CfgConfig - ConfigConfig, wat) - Has information 
passed via the kcfgc file
  - kcfg_compiler - will be renamed to main - start the other classes and 
generates the files.
  
  This code here currently has the begining of this separation, with the 
CodeGenerator and the HeaderGenerator in a ~good~ state, but unfinished.

REPOSITORY
  R237 KConfig

REVISION DETAIL
  https://phabricator.kde.org/D26202

To: tcanabrava
Cc: ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2019-12-23 Thread Nathaniel Graham
ngraham added a comment.


  > This is really a wip, completely broken. It's just so people can point me 
to the right direction.
  
  Maybe could you clarify which direction you want to be pointed in? What's the 
goal here? What do you need help with?

REPOSITORY
  R237 KConfig

REVISION DETAIL
  https://phabricator.kde.org/D26202

To: tcanabrava
Cc: ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26202: WIP: Refactor KConfigXT

2019-12-23 Thread Tomaz Canabrava
tcanabrava created this revision.
Herald added a project: Frameworks.
Herald added a subscriber: kde-frameworks-devel.
tcanabrava requested review of this revision.

REVISION SUMMARY
  This is really a wip, completely broken. It's just so people can point me to
  the right direction.
  
  Rework CfgEntry
  
  Remove commented code
  
  Add base class `KConfigCodeGenerator`, a helper to generate the Header and 
Source files
  
  Add new KConfigHeaderGenerator / Share the common Structs
  
  KConfigHeaderGenerator will generate the Header,
  it uses the same structs as the kconfig_compiler.cpp
  
  Create a Struct for the parse results and use it.
  
  Fix header Generation
  
  Implement the Enums / Move Quite of code around
  
  Moved Create Constructor
  
  Move Destructor
  
  Move `This` and `Const` special Vars to ConfigCodeGenerator

REPOSITORY
  R237 KConfig

BRANCH
  megaRefactor

REVISION DETAIL
  https://phabricator.kde.org/D26202

AFFECTED FILES
  src/kconfig_compiler/CMakeLists.txt
  src/kconfig_compiler/KConfigCodeGenerator.cpp
  src/kconfig_compiler/KConfigCodeGenerator.h
  src/kconfig_compiler/KConfigCommonStructs.h
  src/kconfig_compiler/KConfigHeaderGenerator.cpp
  src/kconfig_compiler/KConfigHeaderGenerator.h
  src/kconfig_compiler/KConfigXTParameters.cpp
  src/kconfig_compiler/KConfigXTParameters.h
  src/kconfig_compiler/kconfig_compiler.cpp

To: tcanabrava
Cc: kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns