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

List:       kde-core-devel
Subject:    Re: readEntry and booleans
From:       David Faure <faure () kde ! org>
Date:       2006-01-04 8:45:45
Message-ID: 200601040945.46158.faure () kde ! org
[Download RAW message or body]

On Wednesday 04 January 2006 02:24, Thomas Braxton wrote:
> As far as I can tell this member template fixes everything
> template <typename T> T readEntry(key, const T&) const
> 
> This seems to work, I ran unsermake check on kdecore and it passes.
> The only problem seems to be, all uses of QVariant::Bool/Int must be replaced 
> & toInt()/toBool() must be replaced to compile. All in all I think the code 
> looks a lot cleaner. You pass in a bool and you get out a bool, so code that 
> looked like this
> if (sc.readEntry(key, QVariant::Bool).toBool())
> now looks like this
> if (sc.readEntry(key, false))

Thanks for that fix. Too bad that we updated the snapshot before it though,
it means we'll have to port the readEntry lines in the other modules twice...

-- 
David Faure, faure@kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).

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

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