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

List:       kde-devel
Subject:    KConfig
From:       Hans Petter Bieker <bieker () stud ! ntnu ! no>
Date:       1999-12-03 14:29:55
[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?

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) {

-bieker-

Norwegian University of Science and Technology, Engineering Cybernetics

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

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