KConfigBase & TODO
David Faure
faure at kde.org
Tue Dec 13 08:57:54 GMT 2005
On Tuesday 13 December 2005 09:22, Thomas Braxton wrote:
> The TODO file has this entry
> - KConfigBase: For all the read*Entry methods that take a QFont *, QPoint *,
> QSize *, etc. for the default value, add overloads that use a const
> reference, so that one can write
> resize( config->readSizeEntry( "Bleh", size() ); for example. Constructing a
> null QFont/QPoint/QSize is cheap enough to justify a consistent and usable
> API (IMHO) .
> Keep source compatibility.
>
> I was wondering if this patch is correct and if so should I remove the item
> from the TODO file or just mark it as done when I commit?
Well, there was this other thread where it was said that we should clean up that
API and use only QVariant.
resize( config->readSizeEntry( "Bleh", size() ) );
would become
resize( config->readEntry( "Bleh", size() ).toSize() );
but the KConfigBase API would be very much simpler.
(And I withdraw my comment about speed, kconfig isn't as much used in
tight loops as e.g. KIO::UDSEntry is).
Maybe we can do this progressively, with a readVariantEntry, marking the
existing methods as deprecated, and then when most code has been ported
to readVariantEntry, we can just s/readEntry/readVariantEntry/ everywhere.
--
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