readEntry and booleans

David Faure faure at kde.org
Fri Jan 6 10:39:06 GMT 2006


On Friday 06 January 2006 10:04, Thomas Braxton wrote:
> On Thursday 05 January 2006 14:14, Thomas Braxton wrote:
> > In the template code I could probably change it to a compile time concept
> > check, but it's been a while since I've done any meta-programming, so it
> > might take a few days while I get back up to speed. I think the concept
> > check would be a good idea because it would catch most errors at compile
> > time, where the programmer could fix them before they got out to users.
> 
> This didn't take me as long as I thought. here is a patch with both 
> compile-time checks and kcbError's. And the header that implements the 
> compile-time checks. What do you think?

Hmm; this is getting complex. I like the idea of compile-time checks of course,
but I wonder if it's a good idea to duplicate the list of types that QVariant supports,
since this is bound to become outdated. E.g. with Qt::GlobalColor in Qt-4.2 :)

Personally I was fine with the previous patch, given that as I said the app code
will most probably pass the same type always, so developers will catch that
anyway... What does QSettings do with unsupported QVariant types btw?


> #define _IsUnused __attribute__ ((__unused__))
This looks like it won't be portable to other compilers than gcc.
Whether the whole template thing compiles on with other compilers
is an open question, but with an easy solution of course: we could
set USE_CONCEPT_CHECK (strange name? why not, hmm, KCONFIG_QVARIANT_CHECK?)
only with gcc.

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





More information about the kde-core-devel mailing list