config-aware widgets (was: Re: Experiences with KDE-CVS at LinuxWorldExpo)

Marc Mutz Marc.Mutz at uni-bielefeld.de
Tue Nov 12 11:57:02 GMT 2002


On Monday 11 November 2002 23:59, Waldo Bastian wrote:
<snip>
> >config->readEntry( "myConfgiKey", myDefault );
> >
> >is a runtime-error that's quite hard to find.
>
> Change notification will not change that.

I never asserted it did ;-)
That was to explain why you want to have config key handling moved into 
a configmanager class.
The point I was trying to make is that config-aware widgets alone thward 
applying this method, since you need the widgets and the manager to 
know the keys and defaults again.

> However, if we have formal
> documentation for config options we can at least detect that this
> option has not been defined.

Exactly.

> >If we have config-aware KCheckBoxes, this solves the problem of
> >immutable keys being presented correctly in the config dialog, but
> >introduces other complexities like having again two places in the
> > app code that need to know the config keys and it's defaults.
>
> Those complexities are not introduced by that, we have those today
> already.

See above. KMail's identities currently don't suffer from that.

> >IMO, we'd need at least:
<snip>
> >3. Change notification for KConfig keys and groups
>
> It would be a nice new feature but I don't think it is very
> important, it is not really hard to send some signals yourself if you
> need that kind of functionality.

It's necessary to be able to move more of the config manager 
functionality into KConfig itself, to get rid of the config key 
knowledge duplication. See Havoc's mail.

> I wonder if (2) could be handled with (4) as well, as Josef suggests.
> That would make things a lot easier. You get problems when you want
> to disable widgets as part of the GUI behavior as well as due to its
> immutable state, but maybe it works if we can reserve disable/enable
> for GUI behavior and read-only to indicate immutable.
<snip>

It would be relatively easy with Qt's property system, iff there was a
a property "configValue" or something like that for every simple widget 
that would contain the config data. The point is that its name is 
common to all widgets, so you can loop over all children of the dialog 
and query the configValue property as QVariant using
QObject::property( "configValue" );

Something for K* widgets?

Marc

-- 
Mutig warf sich die kleine Überwachungskamera zwischen Täter und Opfer!
                                        --Rena Tangens / FoeBuD e.V.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: signature
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20021112/d5b9631c/attachment.sig>


More information about the kde-core-devel mailing list