list separator in config entries

Andreas Pakulat apaku at gmx.de
Wed Oct 10 09:33:02 BST 2007


On 10.10.07 03:22:57, Thomas Braxton wrote:
> On 10/9/07, Nhuh Put <nhuh.put at web.de> wrote:
> will probably not now how it works and wonder why writing an empty (or null)
> > QByteArray deletes the entry. This can lead to some nasty suprises.
> 
> 
> That's what API docs are for. Writing a null QByteArray will delete the
> entry, writing an empty QByteArray will store an empty entry in the config
> file. null and empty are _not_ treated the same.

As I said before thats a surprising thing to users of the API because
QByteArray's own functions treat null the same as empty. Qt tells people
to use isEmpty() instead of isNull() always and that isNull() only
exists for historical reasons.

So if you need a way to delete entries you should have introduced a
function thats called "deleteEntry" or at least a flag for writeEntry
that makes it clear an entry is deleted.

Such behavioural changes depending on the content of a variable are not
really good for a public API.

Andreas

-- 
Expect a letter from a friend who will ask a favor of you.




More information about the kde-core-devel mailing list