Tons of questions. And some patches

Frans Englich frans.englich at telia.com
Sun Jan 25 14:41:11 GMT 2004


On Sunday 25 January 2004 01:47, John Firebaugh wrote:
> On Jan 24, 2004, at 8:33 AM, Tobias Koenig wrote:
> > On Sat, Jan 24, 2004 at 03:27:55PM +0100, Frans Englich wrote:
> > Hi Frans,
> >
> >> +QStringList KConfigBase::readListEntry( const QString& pKey, const
> >> QString& aDefault,
> >> +		  const char sep) const
>
> The default type should match the result type, and const value
> parameters are non-idiomatic. In other words, this should be:

Attached is a new try, perhaps better. I removed the const for the 'char sep' 
argument, but I don't understand why it's better that way. I don't see why 
it's the idiomatic way(perhaps "idiomatic" has a special meaning in the c++ 
field..).
I further don't understand why there's convenience functions for 
QString&/char* pKey - why not only the QString function?

It does not use QChar instead of char. Since all the other helper functions 
use char I guess the conversions when passing the value around could result 
in a mangled value. And switching everything to QChar would break BC and 
should thus be a KDE4 change.. But I am equally convinced I have no idea of 
what I'm talking about.

Cheers,

		Frans



>
> QStringList readListEntry( const QString& pKey, const QStringList&
> aDefault, char sep )
>
> > Shouldn't it be
> >    if ( !hasKey( pKey ) )
> >      return aDefault;
> >    else
> >      return readListEntry( pKey, sep );
> >
> > Otherwise when you save an empty list the default data will be read
> > next
> > time.
>
> Yes, that too.
>
> -John
-------------- next part --------------
A non-text attachment was scrubbed...
Name: add_readlst_default2.diff
Type: text/x-diff
Size: 2891 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20040125/6f7d2fff/attachment.diff>


More information about the kde-core-devel mailing list