Forwarding headers for kdelibs

Hamish Rodda rodda at
Thu Nov 9 04:03:18 GMT 2006

On Tuesday 07 November 2006 09:52, Jaison Lee wrote:
> On 11/6/06, Thiago Macieira <thiago at> wrote:
> > Allen Winter wrote:
> > >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.
> >
> > Why should we force ourselves to open an extra file per header included?
> Be that as it may, I'd be willing to make that sacrifice in the name
> of indirection and standardization.
> One thing I will say: the forwarding headers will make it much easier
> to catch unused headers when grepping around for things.
> During porting I've come across tons of files that were including
> headers for no good reason. The downside is that whenever you grep for
> a class you are now likely to get two hits per file: one being the
> #include.
> Without a check I can't say I'll like the look of the eventual
> mishmash most files will have at the top after a year or so:
> #include "ktemporaryfile.h"
> #include "KSaveFile"
> #include "klockfile.h"
> Perhaps a Krazy check that only asks for the programmer to standardize
> on one or the other type of include in the same file?

I don't think that mandating the use of these headers is a good idea.  
However, a suggestion to standardise makes more sense.

> Another thought: Once (if?) the group forwarders are put in (#include
> "KDECore" or whatever) I think requiring a group header if the file is
> including a high percentage of the headers already would be nice. What
> with the license, copyright, and all the headers you usually have to
> scroll once or twice before you can even see any code. :)

With this, you really will get a compiling speed downgrade unless you're using 
a robust form of preprocessed headers.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <>

More information about the kde-core-devel mailing list