Thanks Richard,<br><br>That seems to be the problem. <br>What I was telling in my earlier mail is that the javascript binding seems to have a similar problem with plasmoid.dataEngine("engine name").serviceForSource("source name") and maybe they solved it by implementing the service function: plasmoid.service("engine name", "source name") (and method Plasma::Applet#service is not implemented in ruby ) . <br>
<br><div class="gmail_quote">On Tue, Aug 18, 2009 at 2:21 PM, Richard Dale <span dir="ltr"><<a href="mailto:richard.j.dale@gmail.com">richard.j.dale@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="h5">On Tue, Aug 18, 2009 at 12:45 PM, Richard Dale<<a href="mailto:richard.j.dale@gmail.com">richard.j.dale@gmail.com</a>> wrote:<br>
> On Tue, Aug 18, 2009 at 9:24 AM, Cédric<<a href="mailto:kde@xfou.com">kde@xfou.com</a>> wrote:<br>
>> Well,<br>
>><br>
>> Thanks for your answer Aaron.<br>
>><br>
>> I think your first suggestion is the write one. I tried to implement this<br>
>> code with the Javascript binding and in the tutorial page<br>
>> (<a href="http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/CheatSheet" target="_blank">http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/CheatSheet</a>)<br>
>> they state this :<br>
>><br>
>> DO NOT use plasmoid.dataEngine("engine name").serviceForSource("source<br>
>> name") - you will get a dummy service back (in 4.2 at least).<br>
>> Instead, use plasmoid.service("engine name", "source name")<br>
>><br>
>> and so in javascript the second method works but in ruby the service method<br>
>> does not seems to exist.<br>
> As far as I can see serviceForSource() exists in the Ruby bindings and<br>
> should work:<br>
><br>
> $ rbqtapi -rplasma_applet -mserviceForSource<br>
> Plasma::Service* Plasma::DataEngineScript::serviceForSource(const QString&)<br>
> Plasma::Service* Plasma::DataEngine::serviceForSource(const QString&)<br>
><br>
> So we are calling in on an actual Plasma::DataEngine here, not a<br>
> DataEngineScript. If I this debugging print out the various items<br>
> created like this:<br>
><br>
> engine = dataEngine("tasks")<br>
> sources = engine.sources<br>
> pp engine<br>
> p sources<br>
> service = engine.serviceForSource(engine.sources[1])<br>
> pp service<br>
> p service.operationNames<br>
> close_description = service.operationDescription("close")<br>
> pp close_description<br>
> service.startOperationCall(close_description)<br>
><br>
> I get:<br>
><br>
> #<Plasma::DataEngine:0xa8ef8f3c<br>
> children=Array (15 element(s)),<br>
> metaObject=#<Qt::MetaObject:0x0 className=TasksEngine,<br>
> superClass=#<Qt::MetaObject:0x0 className=Plasma::DataEngine>>,<br>
> objectName=Window Information,<br>
> sources=nil,<br>
> valid=true,<br>
> icon=user-desktop><br>
><br>
> ["71303776", "65011736", "52428825", "60817446", "16777241",<br>
> "67108924", "69206018", "44040217", "37748765", "27262978",<br>
> "46137441", "58720281", "62914562", "71303343", "56623131"]<br>
><br>
> #<Plasma::Service:0xa8ef69e4<br>
> parent=#<TasksEngine:0x0 objectName="Window Information">,<br>
> metaObject=#<Qt::MetaObject:0x0 className=Plasma::Service,<br>
> superClass=#<Qt::MetaObject:0x0 className=QObject>>,<br>
> objectName=nil><br>
><br>
> []<br>
><br>
> #<KDE::ConfigGroup:0xa8ef52ec><br>
><br>
> So is that Plasma::Service a dummy one? How can I tell? Is doesn't<br>
> seem to have got any operation names associated with it.<br>
</div></div>When I print out the name of the service I get "NullService", which I<br>
assume is why it doesn't have operations. So what do the bindings need<br>
to do to get a real service back instead?<br>
<div><div></div><div class="h5"><br>
-- Richard<br>
_______________________________________________<br>
Plasma-devel mailing list<br>
<a href="mailto:Plasma-devel@kde.org">Plasma-devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/plasma-devel" target="_blank">https://mail.kde.org/mailman/listinfo/plasma-devel</a><br>
</div></div></blockquote></div><br>