Review Request: Add support for nested namespaces to kconfig_compiler

Olivier Serve tifauv at gmail.com
Mon Aug 3 00:46:06 BST 2009


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/1218/
-----------------------------------------------------------

(Updated 2009-08-02 23:46:06.468985)


Review request for kdelibs.


Changes
-------

Updated diff with functions instead of macros and the spaces after "KUrl;" back (they where removed by kate).

I tried to run the tests, but for some reason they fail on both the unpatched and patched versions on my box. That may be caused by the fact that I don't have a full KDE developement environment (not enough free disk space).


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 (updated)
-----

  /trunk/KDE/kdelibs/kdecore/kconfig_compiler/kconfig_compiler.cpp 1006011 

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