DataEngine and actions

Alex Merry huntedhacker at tiscali.co.uk
Thu Jul 31 13:02:00 CEST 2008


On Thursday 31 July 2008 09:23:53 Ivan Čukić wrote:
> For example, tasks in the tasks data engine could have the activities
> 'minimize', 'close', 'activate'... the places engine could have 'open',
> 'unmount'... the contacts engine.. etc. You get the picture.

> This implies that Plasmoid developers should know KDE's APIs even for the
> simplest tasks (creating a device notifier should really be trivial).

Isn't this what Plasma::Service provides?

So the tasks engine would, for example, implement serviceForSource to return a 
Plasma::Service for a given task id.  Then the tasks applet could do

Plasma::Service* service = dataEngine("tasks")->serviceForSource(taskId);
service->startOperation(service->operationParameters("activate"));

They'd have to do some KConfigGroup stuff if they wanted to pass arguments.  
Also, there's currently no API for finding out whether a given action is 
possible for a given data source (so I'm passing that info from the data 
engine in nowplaying, for example).

If you're interested in seeing Plasma::Service in action, have a look at the 
nowplaying dataengine and applet.

Alex



-- 
KDE: http://www.kde.org
Ubuntu/Kubuntu: http://www.ubuntu.org http://www.kubuntu.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20080731/dcc9ccb4/attachment.pgp 


More information about the Plasma-devel mailing list