KConfigGroup (Re: KDE/kdelibs/khtml)

Simon Hausmann hausmann at kde.org
Mon Feb 12 09:18:08 GMT 2007


On Sunday 11 February 2007 23:00:33 Aaron J. Seigo wrote:
> On February 11, 2007, Ingo Klöcker wrote:
> > On Saturday 10 February 2007 23:54, David Faure wrote:
> > > On Friday 09 February 2007, Aaron J. Seigo wrote:
> > > >  - a method in KConfig that returns a KConfigGroup object
> > >
> > > Does this change anything?
> > >   KConfigGroup group = KGlobal::config()->configGroup("bar");
> > > instead of
> > >   KConfigGroup group = KConfigGroup( KGlobal::config(), "bar" );
> > > ?
> > > Can't see much improvement (only more object copying).
> >
> > [snip]
> >
> > > > perhaps even KConfigGroup(const QString& group) to shortcut this
> > > > idiom: KConfigGroup group(KGlobal::config(), "bar");
> > >
> > > would become KConfigGroup group("bar")... Hmm. A bit too much hidden
> > > magic to my taste but I guess it makes the simple case (kmyapp) a bit
> > > simpler. So I guess I'm ok with that one.
> >
> > What about
> >   KConfigGroup group = KGlobal::configGroup("bar") ?
> >
> > It's longer than KConfigGroup("bar"), but avoids the hidden magic.
>
> mm. yeah, that's even better imho.

But it has the downside that one has to learn about two KConfigGroup and 
KGlobal ;(. If the first thing people see in the documentation when they want 
to learn about KConfigGroup is that they have to use it together with another 
class called KGlobal I bet they'd find it confusing.

Simon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070212/e363714d/attachment.sig>


More information about the kde-core-devel mailing list