[PATCH] KConfig: Rewrite globals only if modified

Oswald Buddenhagen ossi at kde.org
Mon Feb 25 11:06:16 GMT 2008


On Mon, Feb 25, 2008 at 11:29:09AM +0100, Chusslove Illich wrote:
> Take three (no unwarranted changes)?
> 
let's see ... ;)

i mentioned in my first reply that it should be only one loop that
determines both writeGlobals and writeLocals to keep the penalty low.

> +        if (writeLocals) {
> +            if (d->mBackend->writeConfig(utf8Locale, d->entryMap, KConfigBackend::WriteOptions(), d->componentData))
> +                d->bDirty = false;
> +        }
> +        else {
>              d->bDirty = false;
> +        }
that bDirty stuff looks wrong. maybe that would work:
once the function is entered, set bDirty false.
then, either of the branches can re-assert bDirty if writeout fails.
that should keep everything consistent easily.

-- 
Hi! I'm a .signature virus! Copy me into your ~/.signature, please!
--
Confusion, chaos, panic - my work here is done.




More information about the kde-core-devel mailing list