[Kde-bindings] Bug in rbuic: any class/module starting wih K gets prefixed with KDE::

Arno Rehn arno at arnorehn.de
Thu Dec 3 13:07:34 UTC 2009


On Thursday 03 December 2009 01:02:05 Riyad Preukschas wrote:
> Hi,
> 
> I have found a few issues in rbuic mostly regarding prefixing KDE classes
>  with "KDE::":
> 
> *Any* custom widget used in a .ui-file with a class name that starts with a
>  K gets converted to KDE:: even those that are not part of the KDE
>  bindings. Try something like Kfoo::Bar::BazWidget in QtDesigner which gets
>  converted to KDE::foo::Bar::BazWidget by rbuic even if Kfoo is your own
>  non-KDE module.
> 
> I don't know whether this is easily fixable or this is intended and just
>  not well documented. My approach would be to only KDE-prefix it if there
>  is a constant definition in the KDE module for it otherwise leave it as
>  is.
I see a few options here:
1. Only convert classes starting with 'K' and another capital letter to 
KDE::Foo (like KFoo -> KDE::Foo, but Kfoo will stay Kfoo)
2. Keep a list of kde classes in rbuic (probably very ugly).
3. Dynamically try to load smokekde and look if the class is actually part of 
KDE. This would work for sure and would also be easily maintainable, now that 
the init_smoke functions are extern "C". I guess it's not the fastest 
solution, though.

-- 
Arno Rehn
arno at arnorehn.de



More information about the Kde-bindings mailing list