[patch] klineedit: use isEmpty()

Jaroslaw Staniek js at iidea.pl
Tue Apr 8 11:19:41 BST 2008


Andreas Hartmetz said the following, On 2008-04-08 10:04:

> Haha, great. I read some QString code (*) to confirm my suspicion that 
> isNull() is just a deprecated way of saying isEmpty(). The thing is that 
> (shock) they actually differ! isNull() will check if the private class 
> instance is the shared null, isEmpty() will check for string length zero.
> I conclude that QString::isNull() is Evil because in 99,5% of cases you 
> shouldn't care why and how a string is/has become empty.
> (This is not news to many, I know)
> 
> (*) the difference is actually documented, too :)

Yeah, so what now? Time to inspect all the code for isNull() and change?

Sometimes I also think about Krazy check for this...

In fact I do pay attention to isEmpty()/isNull() differences, coming from the 
old Qt era, because I use both methods (on purpose) in database apps where we 
have heavy use of EMPTY and NULL properties, e.g. in Kexi.

-- 
regards / pozdrawiam, Jaroslaw Staniek
  Sponsored by OpenOffice Polska (http://www.openoffice.com.pl/en) to work on
  Kexi & KOffice (http://www.kexi.pl/en, http://www.koffice.org/kexi)
  KDE Libraries for MS Windows (http://windows.kde.org)




More information about the kde-core-devel mailing list