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

List:       kde-devel
Subject:    RE: KConfig
From:       "David Faure" <faure () kde ! org>
Date:       1999-12-03 14:45:31
[Download RAW message or body]

> config->readEntry("Bla", default) used to return default if the config
> files contained the folowing:
> Bla=
> 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?

Why is QString::right(0) called at all ?
This looks wrong to me...

> Index: kconfigbackend.cpp
> ===================================================================
> RCS file: /home/kde/kdelibs/kdecore/kconfigbackend.cpp,v
> retrieving revision 1.22
> diff -u -r1.22 kconfigbackend.cpp
> --- kconfigbackend.cpp	1999/11/26 12:27:38	1.22
> +++ kconfigbackend.cpp	1999/12/03 13:46:21
> @@ -212,7 +212,7 @@
>  
>      KEntryKey aEntryKey = { aCurrentGroup, key };
>      KEntry aEntry;
> -    aEntry.aValue = val;
> +    aEntry.aValue = val.isEmpty()?QString::null:val;
>      aEntry.bGlobal = bGlobal;
>  
>      if (pWriteBackMap) {

I would fear this would break other things, but if you tested it... :-)

--
David Faure
faure@kde.org - KDE developer
david@mandrakesoft.com - Mandrake
david.faure@cramersystems.com - Cramer Systems

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

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