Review Request: Add support for nested namespaces to kconfig_compiler
Pino Toscano
pino at kde.org
Sun Aug 2 17:58:47 BST 2009
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/1218/#review1882
-----------------------------------------------------------
Did you compiled and run the kconfig_compiler test suite?
It is in kdelibs/kdeui/tests/kconfig_compiler.
/trunk/KDE/kdelibs/kdecore/kconfig_compiler/kconfig_compiler.cpp
<http://reviewboard.kde.org/r/1218/#comment1230>
Why macros?
Please replace those with simple helper functions (eg beginNamespace() + endNamespace()), just like other helper functions in kconfig_compiler.cpp
/trunk/KDE/kdelibs/kdecore/kconfig_compiler/kconfig_compiler.cpp
<http://reviewboard.kde.org/r/1218/#comment1231>
Strictly unneeded change, please remove it.
- Pino
On 2009-08-02 15:52:28, Olivier Serve wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/1218/
> -----------------------------------------------------------
>
> (Updated 2009-08-02 15:52:28)
>
>
> Review request for kdelibs.
>
>
> Summary
> -------
>
> This patch adds support for nested namespaces to kconfig_compiler.
>
> If you try to use "Namespace=foo::bar" in a .kcfgc file, kconfig_compiler will generate code that doesn't compile.
>
> The patch does three things :
> 1. define 2 macros to add the start-of-namespace and end-of-namespace statements ;
> 2. replace the '::' by '_' in the #ifndef/#define part of the header (so that gcc doesn't issue a warning)
> 3. use the macros 3 times (once in the .h, twice in the .cpp)
>
> Take a look at the associated bug report : https://bugs.kde.org/show_bug.cgi?id=202088
>
>
> This addresses bug 202088.
> https://bugs.kde.org/show_bug.cgi?id=202088
>
>
> Diffs
> -----
>
> /trunk/KDE/kdelibs/kdecore/kconfig_compiler/kconfig_compiler.cpp 1005922
>
> Diff: http://reviewboard.kde.org/r/1218/diff
>
>
> Testing
> -------
>
> First, kconfig_compiler compiles fine :-)
>
> Then, I tested with 3 sample .kcfgc (no namespace, 1 namespace, 2 nested namespaces) and the results seems OK to me.
> Here are the sample kcfgc files :
>
> ---------- nons.kcfgc ----------
> File=libplop_la.kcfg
> ClassName=NoNS
> Singleton=true
> Mutators=true
> --------------------------------
>
> ---------- with1ns.kcfgc ----------
> File=libplop_la.kcfg
> ClassName=With1NS
> Namespace=ns1
> Singleton=true
> Mutators=true
> --------------------------------
>
> ---------- with2ns.kcfgc ----------
> File=libplop_la.kcfg
> ClassName=With2NS
> Namespace=ns1::ns2
> Singleton=true
> Mutators=true
> --------------------------------
>
>
> Thanks,
>
> Olivier
>
>
More information about the kde-core-devel
mailing list