[PATCH] Allow reading of values on invalid KConfigGroups

Sebastian Trüg trueg at kde.org
Tue Feb 24 12:47:09 GMT 2009


On Tuesday 24 February 2009 09:58:27 Oswald Buddenhagen wrote:
> On Mon, Feb 23, 2009 at 10:02:26PM +0100, Sebastian Trüg wrote:
> > The attached patch allows to read values from invalid KConfigGroups
> > instead of throughing an assert. This allows to reuse typical
> > loadSettings(const KConfigGroup&) methods for loading of defaults. In my
> > case it allowed to remove a lot of code duplication from K3b.
> >
> > Comments?
>
> +1 as far as i'm concerned.

OK, great. Actually I thought I did not even send this email. KMail troubles. 
In the end I solved it another way: I simply call setReadDefaults(true) on the 
global config before calling the loadConfig methods. This has the additional 
advantage that one can change the defaults by installing a global config file 
(not that anyone will ever do this ;)

I still think, however, that this patch makes sense. Should I wait for more 
comments or go ahead?

> btw, it makes sense to create such patches with diff -b. if you have a
> minor glitch somewhere, nobody would be able to spot it with the patch
> being as is.
> a copy without -b to check the indentation is needed as well, of course.
>
> :)





More information about the kde-core-devel mailing list