On Tuesday, February 7, 2012 13:56:32 Eric Mesa wrote:
> I have a data engine that grabs some data off the web, chugs it and then
> presents it to my plasmoid.  How could my plasmoid tell the data engine
> that its data is now out of date and it should regrab its data?  Even
> better would be the ability to tell it to update only one of its 20 sources.

this is almost certainly an incorrect usage of the dataengine design.

the plasmoid (almost) never tells the engine when to reload. how can it when 
it is simply a visualization of the data? if the visualization knows such 
things, it is not longer a visualization. if the dataengine does not know such 
things then it is no longer a true manager of data.

no. the dataengine itself must know when and how to reload data. the only 
thing a visualization can do is request updates every N ms (time based 
updates).

if the plasmoid wants to reload the data after a certainly timelapse, then use 
that feature in the connectToSource call.

if the data is outdated by some event, then the DataEngine should know how to 
react to that event.

if, for some unfortunate reason, it is due only to user interaction in the 
visualization then the DataEngine needs to provide a Service (returned by 
serviceForSource in the DataEngine implementation) that can be used by the 
visualization.

however, i would strongly encourage you to first ensure that the use case is 
actually correct.

cheers ...

-- 
Aaron J. Seigo

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel

Reply via email to