[Panel-devel] patch: dataengines and timing

Michael Olbrich michael-olbrich at web.de
Tue Aug 7 00:57:57 CEST 2007


Hi,

it's been a while since I brought up this topic. I have looked at the
growing list of dataengines and this time I actually came up with some
code.

The attached patch adresses two issues I have seen in data engines.

1. Many engines create a timer with a more or less random timeout.
   Always the same code. The timer is created in the constructor,
   started when the first source is requested, but unfortunately never
   stoped.
   With this patch the engine specifies a default timeout and a slot
   that is called when necessary.

2. As I said in a previous thread different applets may require
   different timeouts.
   The patch adds an optional parameter to DataEngine::connectSource
   with it an applet can request a custom timeout.

I have also added patches for the time engine/clock applet and the
networkapplet that make use of this functionality.
As far as I can tell the patch is source compatible and should not break
any other functionality.

I'm not quite satisfied with this. I've been playing whith the code for
a while now and I couldn't come up with anything better. Maybe someone
else has some ideas to improve it.

Should anyone wonder why I created a separate class: I've been toying
with the idea to use the same mechanism to share timers between
dataengines. Sofar I don't have enough data to support an argument for
the added complexity.

michael

-------------- next part --------------
A non-text attachment was scrubbed...
Name: libplasma.patch
Type: text/x-diff
Size: 19059 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20070807/fe78b431/attachment-0003.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clock.patch
Type: text/x-diff
Size: 5018 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20070807/fe78b431/attachment-0004.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: network.patch
Type: text/x-diff
Size: 2395 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20070807/fe78b431/attachment-0005.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20070807/fe78b431/attachment-0001.pgp 


More information about the Panel-devel mailing list