[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: KConfig
From:       Harri Porten <porten () tu-harburg ! de>
Date:       1999-12-04 2:16:55
[Download RAW message or body]

Hans Petter Bieker wrote:
> 
> config->readEntry("Bla", default) used to return default if the config
> files contained the folowing:
> Bla=

When ? In KDE 1.x or previous HEAD versions ? IIRC the current behaviour
is the one from 1.x and that's a good thing.

> Now it returns "" because QString::right(0) was changed to return ""
> instead of QString::null. Some code depends on the old behaviour (like
> KLocale and libkcm_locale). The patch below changes KConfig to return
> defualt instead of "". May I commit it?

I definetely prefer "" as return value. How do you want to store empty
entries otherwise ? Storing something like <empty> ? This would require
patching all apps that allow user editable values.
The provided default value should only be returned if the key is
completely missing.

Harri.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic