Review Request: DataEngine: Add methods to allow disabling auto-deletion of data sources created on demand

Aaron Seigo aseigo at kde.org
Sat Sep 11 03:20:51 CEST 2010



> On 2010-09-10 23:56:04, Aaron Seigo wrote:
> > if there is nothing connected to it, why would it want to fill that data? if nothing is connected, then there is precisely no reason to deliver that data. it sounds like the system monitor engine is doing something wrong.
> 
> Alex Merry wrote:
>     System monitor maintains its list of sources (ie: things that can be monitored) by maintaining a bunch of DataContainers.  Ordinarily, these just have some meta-information about the thing being monitored, such as a human-readable name and the units.  Only when a source is connected to are the values updated.
>     
>     This is not an unusual approach to take, as far as I'm aware - that's kind of the point of DataContainer, right?  It's just that systemmonitor doesn't bother subclassing DataContainer, but instead uses it directly.
>     
>     Note that the way KSysGuard works means that if it fetches the list of things that can be monitored, it has to fetch the meta-info as well, so it may as well store it.  The issue is simply that it has to fetch this asynchonously, and visualizations may request a source before it has done so.

"This is not an unusual approach to take"

no, it is quite unusual. a DataContainer, once added to an engine due to a sourceRequestEvents not only represents that source but the source has the lifespan of the request.

instead, what it ought to do is add all the DataContainers using DataEngine::addSource(DataContainer *) and then update them in updateRequestEvent. this behaviour can be triggered with setMinimumPollingInterval(0). this is documented in the apidox and is the way to get the desired behavior.

so, yes, SystemMonitor is at fault here :)


- Aaron


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://svn.reviewboard.kde.org/r/5312/#review7530
-----------------------------------------------------------


On 2010-09-10 23:30:32, Alex Merry wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://svn.reviewboard.kde.org/r/5312/
> -----------------------------------------------------------
> 
> (Updated 2010-09-10 23:30:32)
> 
> 
> Review request for Plasma.
> 
> 
> Summary
> -------
> 
> Allow DataEngine implementations to prevent DataEngine from automatically deleting sources create in sourceRequestEvent.
> 
> Rationale: engines that fetch a list of sources asynchronously at creation time (such as systemmonitor) may reasonably want to create dummy data sources when they are requested before the list has been fetched.  However, they probably don't want these to be removed again when disconnected from.
> 
> 
> Diffs
> -----
> 
>   /trunk/KDE/kdelibs/plasma/dataengine.cpp 1173953 
>   /trunk/KDE/kdelibs/plasma/private/dataengine_p.h 1173953 
>   /trunk/KDE/kdelibs/plasma/dataengine.h 1173953 
> 
> Diff: http://svn.reviewboard.kde.org/r/5312/diff
> 
> 
> Testing
> -------
> 
> It makes the systemmonitor engine work properly.  Specifically, it solves the bug in bubblemon where if you had the bubblemon displaying, say, CPU Total Load when plasma started and then changed it to, say, CPU Idle Load, the CPU Total Load source would be removed and there would be an empty place where it should be in the list in the config dialog.
> 
> 
> Thanks,
> 
> Alex
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/plasma-devel/attachments/20100911/b32ae909/attachment-0001.htm 


More information about the Plasma-devel mailing list