Forwarding headers for kdelibs

Allen Winter winter at kde.org
Mon Nov 6 21:47:26 GMT 2006


On Monday, November 6, 2006 02:23:42 AM Hamish Rodda wrote:
> On Thursday 12 October 2006 23:37, Hamish Rodda wrote:
> > On Monday 02 October 2006 23:02, Hamish Rodda wrote:
> > > Hi,
> > >
> > > Just wanted to let you know I've started work on creating forwarding
> > > headers for kdelibs classes, to support Qt4 style includes on kde
> > > classes. This can of course be extended to any other kde library.
> > >
> > > My generator uses both the build system and a c++ parser (Roberto's
> > > kdevelop-pg like c++ parser, which will be in kdevelop4).  This means
> > > that the generated headers should be correct, even down to only
> > > generating headers for exported classes only.  (There is a problem at the
> > > moment because I am not parsing other included headers, and thus macros
> > > can get in the way of correct parsing, but I intend to fix this.)
> 
> <snip / change...>
> 
> > > To try these headers out, includes like the
> > > following should work:
> > >
> > > #include <KConfig>
> > >
> > > Namespaces are handled with subdirectories, eg:
> > >
> > > #include <KTextEditor/Cursor>
> 
> Ok, I have now committed these files, and patched Kate (in kdebase) to use 
> them as proof-of concept.
> 
> The last remaining deficiencies that I am aware of are:
> - namespaces with exported functions do not have forwarding headers generated 
> for them, e.g. KStdAccel, KStdAction etc.
> - I have not (yet?) created catchall includes, eg. like with Qt you can do 
> #include <QtGui>
> 
> For the moment, if small changes are needed you can make them by hand, or ask 
> me to regenerate the includes.  Sometime soon hopefully the cmake change will 
> get merged and anyone will be able to perform the generation.
> 
I wonder.. should we have a krazy check that notifies us to change includes
of the form
#include <kfoo.h> or #include "kfoo.h"  
to
#include <KFoo>

Same question for the Qt forwarding headers.

??







More information about the kde-core-devel mailing list