[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    Re: Accessing dataengine from different plasmoid
From:       Weng Xuetian <wengxt () gmail ! com>
Date:       2012-02-22 10:32:07
Message-ID: 10905349.eEBBvoDvqt () saber-chakra
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


在 2012年2月22日 星期三 10:45:13,Simone Gaiarin 写道:
> Thank you. The problem was that I didn't run the plasmoid on the same
> process.
> 
> What can be the best way to store a KProcess to the dataengine?
> Idea 1:
> Subclass the DataContainer class and store the KProcess in that class,
> like the Executable dataEngine does. When the source is requested i
> use addSource().
> Idea 2:
> Store the Kprocess as a private member of the dataengine.
> 
>  When I ask for the Service, which is the best way to act on the KProcess?
> Can I create a method to get the KProcess from the datacontainer? Or
> this will break the semantic of the datacontainer, that is supposed to
> just listen to signal updateRequested().
> 
> Example:
> 
> serviceForSource(const QString &source)
> {
> container = query(source);
> pointerToProcess = container.getPointerToProcess();
> return new MyService(pointerToProcess,source);
> }
> 
> The service will implement the operation "start" and "stop" that let
> to pause and resume the process.
> 
I think you can put KProcess in the dataengine as private member, and operate 
it only with dataengine service, not to direct get the pointer.

What's your requirement by the way? I think there might be better solution for 
your idea. 
["signature.asc" (application/pgp-signature)]

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic