Age | Commit message (Collapse) | Author |
|
NO_CHANGELOG
|
|
I didn't consider the '#ifdef Q_OS_WIN' code paths (since that compiles
just fine locally).
GIT_SILENT
|
|
NO_CHANGELOG
|
|
|
|
|
|
Summary: Following D27059, add `parentGroupName` attribute to `group` element to generate kconfig settings with subgroups
Reviewers: ervin, dfaure, #frameworks, meven
Reviewed By: ervin, meven
Subscribers: apol, meven, kde-frameworks-devel
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D27133
|
|
Summary:
Convert license headers to SPDX statements and add
license files as required by REUSE specification.
Reviewers: cgiboudeaux
Reviewed By: cgiboudeaux
Subscribers: ognarb, cgiboudeaux, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T11550
Differential Revision: https://phabricator.kde.org/D27601
|
|
Summary:
- When GenerateProperties and Mutators are activated, the generated code
did not handle min/max properly
- In the case of a parameterized entry, generated code also did not
handle min/max
BUG: 418146
Test Plan: - auto tests included
Reviewers: meven, crossi, ervin, bport, tcanabrava
Reviewed By: meven, ervin
Subscribers: kde-frameworks-devel
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D27497
|
|
Summary:
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.
Currently the code is "done" - there's one bug that I still need to find & fix regarding Translations, but the rest seems sane.
The current testcode generates incorrect *whitespaces* regarding the old code (there's some parts that I feel that it's important to fix before merging, but overall, the whitespace changes are not bad and easier to handle, old code had a hand-counted amount of spaces before each line, new code has a function whitespace() that adds the current-and-correct amount of whitespaces based on indentation level that you start by startScope() and ends with endScope(). rest of the code still needs to be ported to it.
I plan to fix the testcases whitespace by manually adding them, I'v fougth with the code for a while and added a few hacks there but I don't want to make the code hackish again.
New code is not perfect by any means, but is a good step in the right direction.
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 from the Xml file
- 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.
Test Plan:
- Run the test cases,
- Compare the diffs generated by the testcases and fix in the code the errors / differences
- Run and compare real kde source with the new and old generators to look for errors
Reviewers: #frameworks, ervin, bport, dfaure
Reviewed By: dfaure
Subscribers: davidre, bcooksley, cgiboudeaux, kossebau, bport, ngraham, kde-frameworks-devel
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D26202
|
|
This reverts commit 98c32e29f50465d4d4e16bafdf0491edbfb422b0.
This broke kdevelop and kmymoney. I'm workin on the fixes and more
unittests for them.
|
|
Summary:
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.
Currently the code is "done" - there's one bug that I still need to find & fix regarding Translations, but the rest seems sane.
The current testcode generates incorrect *whitespaces* regarding the old code (there's some parts that I feel that it's important to fix before merging, but overall, the whitespace changes are not bad and easier to handle, old code had a hand-counted amount of spaces before each line, new code has a function whitespace() that adds the current-and-correct amount of whitespaces based on indentation level that you start by startScope() and ends with endScope(). rest of the code still needs to be ported to it.
I plan to fix the testcases whitespace by manually adding them, I'v fougth with the code for a while and added a few hacks there but I don't want to make the code hackish again.
New code is not perfect by any means, but is a good step in the right direction.
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 from the Xml file
- 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.
Test Plan:
- Run the test cases,
- Compare the diffs generated by the testcases and fix in the code the errors / differences
- Run and compare real kde source with the new and old generators to look for errors
Reviewers: #frameworks, ervin, bport, dfaure
Reviewed By: dfaure
Subscribers: bport, ngraham, kde-frameworks-devel
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D26202
|
|
Lets you specify Notifiers= in .kcfg for config entries that should be written with Notify flag,
i.e. announce the change to KConfigWatcher
Differential Revision: https://phabricator.kde.org/D20196
|
|
|
|
This way, different newline endings in OSes are handled as \n when
reading, and thus fixing the comparison on non-\n OSes.
|
|
Use the QProcess::start() variant with explicit (empty, in this case)
arguments, so the program string is not parsed as shell command, thus
preserving paths with spaces as such.
|
|
|
|
Summary:
In case a kcfg with arg="true" was used and singleton the static
instance method only accepted a QString config name. This made it
impossible to combine a singleton config with an already existing and
open KSharedConfig::Ptr.
With this change an overloaded instance method is added which takes a
KSharedConfig::Ptr as argument. The private ctor, though, only takes a
KSharedConfig::Ptr and the instance method taking a QString argument
uses KSharedConfig::openConfig on the config file name.
The change is source-incompatible in the following situation:
* kcfgfile arg="true"
* Singleton = true
* Inherits is specified
In this situation the previous revision created an instance method with
a QString argument and passed that to the parent constructor. This is
not in accordance with the documentation. Any user of this behavior was
relying on a bug. With this change now the call to the parent
constructor carries a KSharedConfigPtr.
Test Plan:
kconfigcompiler tests still pass and a config with singleton
and arg="true" generates the code as I need it
Reviewers: #frameworks, dfaure, mdawson
Differential Revision: https://phabricator.kde.org/D3690
|
|
This reverts commit cd4e6504dfbdface00037625f0cedda511e6d839.
As suggested by Martin on release-team@kde.org, given that it breaks SC.
|
|
Summary:
In case a kcfg with arg="true" was used and singleton the static
instance method only accepted a QString config name. This made it
impossible to combine a singleton config with an already existing and
open KSharedConfig::Ptr.
With this change an overloaded instance method is added which takes a
KSharedConfig::Ptr as argument. The private ctor, though, only takes a
KSharedConfig::Ptr and the instance method taking a QString argument
uses KSharedConfig::openConfig on the config file name.
This provides full API compatibility and at the same time allows to use
KSharedConfig in addition to the arg name based variant.
Test Plan:
kconfigcompiler tests still pass and a config with singleton
and arg="true" generates the code as I need it
Reviewers: #frameworks
Differential Revision: https://phabricator.kde.org/D3386
|
|
|
|
In applications translations can be looked up in the globally set
translation domain, but in libraries it is necessary to link every
i18n call to the library's own translation domain. A new code
generation option TranslationDomain= is added to enable this.
It has effect only if TranslationSystem=kde is set.
Added unit tests to check generated translation calls.
CHANGELOG: New code generation option TranslationDomain=, for use with TranslationSystem=kde; normally needed in libraries.
REVIEW: 123872
|
|
|
|
It adds a configuration setting that makes it possible to generate
Q_PROPERTY instances out of each variable exposed by the configuration
class.
Especially useful when it comes to exposing these classes to QtQuick
interfaces.
REVIEW: 123367
CHANGELOG: Generate QML-proof classes using the kconfigcompiler
|
|
Add new variable to specify it in *.kcfgc : "CategoryLoggingName"
CHANGELOG: Allow to generate file with qloggingcategories support.
REVIEW: 122931
|
|
- use Q_NULLPTR instead of 0 or NULL
- simplify some foreach loops
- use QStringLiteral in a few places
- added a few consts
REVIEW: 118666
|
|
We have to generate the files in the same directory as the test executables
otherwise QFINDTESTDATA will fail
|
|
Previously the output of diff -u was written to a file when the
generated file did not match the expectations. Having the output printed
to stdout makes it easier to see the exact error without having to know
that a diff exists in a certain file somewhere in the build directory.
REVIEW: 115832
|
|
Use git blame -w 867e7a5 to show authorship as it was before this commit.
|
|
|