KNewStuff3 vs. KNS3 vs. KNewStuff (was: Re: What are the plans with CamelCase includes?)

Friedrich W. H. Kossebau kossebau at kde.org
Sat Jan 11 01:42:20 UTC 2014


Am Donnerstag, 2. Januar 2014, 15:30:20 schrieb David Faure:
> On Thursday 02 January 2014 14:06:47 Kevin Ottens wrote:
> > On Thursday 02 January 2014 12:25:47 David Faure wrote:
> > > On Thursday 02 January 2014 11:35:43 David Faure wrote:
> > > > See attached patch.
> > > 
> > > I forgot to attach the corresponding patch for ECM.
> > > 
> > > Tested on KParts too, with the addition of a "PREFIX" variable.
> > > 
> > > MODULE_NAME = KParts or KIOCore .. the include dir under KF5, always
> > > titlecase PREFIX = KParts or KIO, the subdir inside MODULE_NAME for
> > > namespaced headers, gets lowercased for lowercase headers.
> > > 
> > > include/KF5/KParts/KParts/BrowserExtension
> > > include/KF5/KParts/kparts/browserextension.h
> > > 
> > > Awaiting for green light.
> > 
> > That would be for the namespaced frameworks only right?
> > 
> > We still plan to have:
> > include/KF5/KCoreAddons/kjob.h
> > include/KF5/KCoreAddons/KJob
> > For the non namespace case?
> 
> Yes.
> 
> include/KF5/MODULE_NAME/the_thing_to_include
> where the_thing_to_include can include a prefix (namespaced headers) or not
> (non-namespaced headers).
> 
> I can see how it looks like duplication when the prefix is equal to the
> module name, but since it's not always the case (KIOCore vs KIO) and since
> there isn't always a prefix (non-namespaced headers), I think this makes
> things consistent.

What about KNewStuff3 forward headers?

There the used namespace does not match the module name:
namespace is "KNS3", the module name "KNewStuff3".
To confuse things, the name of the repo and in the framework is just knewstuff 
or KNewStuff, without the postfix 3, duh.

What about changing the namespace to "KNewStuff" in the framework, and making 
the KNS3 namespace an alias for it in the kde4support headers? Ah, not 
possible, the namespace is in the signature of some headers, so connections 
with SIGNAL() do pick that up literally, ignoring the namespace alias. Bummer.

So "KNS3" or "KNewStuff3" for the prefix? I would opt for "KNS3" to match the 
namespace, see attached patch. Currently the prefix is lowercase, thus wrong 
anyway :)

Cheers
Friedrich
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fixKNewstuffCamelcaseModulename.patch
Type: text/x-patch
Size: 390 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20140111/c6b9289b/attachment.patch>


More information about the Kde-frameworks-devel mailing list