Mapping header names, besides case sensitivity [was: Re: KDE includes]

Frans Englich frans.englich at telia.com
Mon May 9 18:32:06 BST 2005


On Monday 09 May 2005 11:11, Ian Reinhart Geiser wrote:
> Greetings,
> One question I have is the includes in KDE 4.  Qt4 supports QString vs
> qstring.h. Now imho QString is much easier to figure out what include
> supplies the class I need.  The downside is that I am not sure what
> sideeffects this has on our current codebase.  Also, do we want to provide
> these types of includes in KDE 4?

Another topic is how class names maps to their filenames, beyond case 
sensitivity. For example, the class KPasswordDialog(kdeui)'s header isn't 
called "kpassworddialog.h", but "kpassdlg.h". I think there are more cases, 
but cannot come to think of them now.

I think it is important that the file name corresponds 1:1 to the class name, 
because otherwise the user have to figure out whatever shortform the API 
designer decided to use. I neither see the advantage of shortforms: header 
names are typed once.

Another topic is whether to put one or more classes in one file; that approach 
is found here and there in kdelibs. I think it brings the same usability 
problem as above: when the user needs the header for class KCookie, it is 
simply not kcookie.h, but instead some kind of "collection" name for a set of 
classes. Headers are cheap, I vote for practicing one class per header.


However, what I find the most important is consistency. There must be some 
pattern; the worst scenario is when no approach is followed. It is 
unification which creates a single KDE platform. If it's documentation on 
developer.kde.org that people think would make clear what agreements are, 
then that's what's needed to be written.


Cheers,

		Frans








More information about the kde-core-devel mailing list