From kde-core-devel Thu Mar 06 16:19:17 2008 From: Richard Dale Date: Thu, 06 Mar 2008 16:19:17 +0000 To: kde-core-devel Subject: Re: Use of const arg in KConfigGroup constructors doesn't work with Message-Id: <200803061619.17662.rdale () foton ! es> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=120482108627804 On Thursday 06 March 2008 10:49:02 Alex Merry wrote: > On Wednesday 05 March 2008 21:56:54 Richard Dale wrote: > > The attached patch add two extra constructors with a bool 'isConst' > > argument: > > > > /** > > * This variant of the constructor is useful for non-c++ languages > > * without const argument overloading. > > * > > * ### KDE 5 make isConst default to true > > */ > > KConfigGroup(KConfigBase *master, const QString &group, bool > > isConst); KConfigGroup(KConfigBase *master, const char *group, bool > > isConst); > > Surely we want isConst to default to false (or the equivalent with an > enum), s o that c++ retains its const/non-const selection if the default > argument is us ed (ie: behaviour identical to the existing constructors)? Yes, you're right it should be - I noticed that after I sent off the mail with the patch. But I think my change is seen as uglier than the original problem, and so it needs something better, or just leaving the api as it is. I don't think that it is a major problem that scripting languages can't instantiate read-only/const versions of KConfigGroup in the end. -- Richard