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(&quot;engine name&quot;).serviceForSource(&quot;source name&quot;) and maybe they solved it by implementing the service function: plasmoid.service(&quot;engine name&quot;, &quot;source name&quot;) (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">&lt;<a href="mailto:richard.j.dale@gmail.com">richard.j.dale@gmail.com</a>&gt;</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&lt;<a href="mailto:richard.j.dale@gmail.com">richard.j.dale@gmail.com</a>&gt; wrote:<br>
&gt; On Tue, Aug 18, 2009 at 9:24 AM, Cédric&lt;<a href="mailto:kde@xfou.com">kde@xfou.com</a>&gt; wrote:<br>
&gt;&gt; Well,<br>
&gt;&gt;<br>
&gt;&gt; Thanks for your answer Aaron.<br>
&gt;&gt;<br>
&gt;&gt; I think your first suggestion is the write one. I tried to implement this<br>
&gt;&gt; code with the Javascript binding and in the tutorial page<br>
&gt;&gt; (<a href="http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/CheatSheet" target="_blank">http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/CheatSheet</a>)<br>
&gt;&gt; they state this :<br>
&gt;&gt;<br>
&gt;&gt; DO NOT use plasmoid.dataEngine(&quot;engine name&quot;).serviceForSource(&quot;source<br>
&gt;&gt; name&quot;) - you will get a dummy service back (in 4.2 at least).<br>
&gt;&gt; Instead, use plasmoid.service(&quot;engine name&quot;, &quot;source name&quot;)<br>
&gt;&gt;<br>
&gt;&gt; and so in javascript the second method works but in ruby the service method<br>
&gt;&gt; does not seems to exist.<br>
&gt; As far as I can see serviceForSource() exists in the Ruby bindings and<br>
&gt; should work:<br>
&gt;<br>
&gt; $ rbqtapi -rplasma_applet -mserviceForSource<br>
&gt; Plasma::Service* Plasma::DataEngineScript::serviceForSource(const QString&amp;)<br>
&gt; Plasma::Service* Plasma::DataEngine::serviceForSource(const QString&amp;)<br>
&gt;<br>
&gt; So we are calling in on an actual Plasma::DataEngine here, not a<br>
&gt; DataEngineScript. If I this debugging print out the various items<br>
&gt; created like this:<br>
&gt;<br>
&gt; engine = dataEngine(&quot;tasks&quot;)<br>
&gt; sources = engine.sources<br>
&gt; pp engine<br>
&gt; p sources<br>
&gt; service = engine.serviceForSource(engine.sources[1])<br>
&gt; pp service<br>
&gt; p service.operationNames<br>
&gt; close_description = service.operationDescription(&quot;close&quot;)<br>
&gt;  pp close_description<br>
&gt; service.startOperationCall(close_description)<br>
&gt;<br>
&gt; I get:<br>
&gt;<br>
&gt; #&lt;Plasma::DataEngine:0xa8ef8f3c<br>
&gt;  children=Array (15 element(s)),<br>
&gt;  metaObject=#&lt;Qt::MetaObject:0x0 className=TasksEngine,<br>
&gt; superClass=#&lt;Qt::MetaObject:0x0 className=Plasma::DataEngine&gt;&gt;,<br>
&gt;  objectName=Window Information,<br>
&gt;  sources=nil,<br>
&gt;  valid=true,<br>
&gt;  icon=user-desktop&gt;<br>
&gt;<br>
&gt; [&quot;71303776&quot;, &quot;65011736&quot;, &quot;52428825&quot;, &quot;60817446&quot;, &quot;16777241&quot;,<br>
&gt; &quot;67108924&quot;, &quot;69206018&quot;, &quot;44040217&quot;, &quot;37748765&quot;, &quot;27262978&quot;,<br>
&gt; &quot;46137441&quot;, &quot;58720281&quot;, &quot;62914562&quot;, &quot;71303343&quot;, &quot;56623131&quot;]<br>
&gt;<br>
&gt; #&lt;Plasma::Service:0xa8ef69e4<br>
&gt;  parent=#&lt;TasksEngine:0x0 objectName=&quot;Window Information&quot;&gt;,<br>
&gt;  metaObject=#&lt;Qt::MetaObject:0x0 className=Plasma::Service,<br>
&gt; superClass=#&lt;Qt::MetaObject:0x0 className=QObject&gt;&gt;,<br>
&gt;  objectName=nil&gt;<br>
&gt;<br>
&gt; []<br>
&gt;<br>
&gt; #&lt;KDE::ConfigGroup:0xa8ef52ec&gt;<br>
&gt;<br>
&gt; So is that Plasma::Service a dummy one? How can I tell? Is doesn&#39;t<br>
&gt; seem to have got any operation names associated with it.<br>
</div></div>When I print out the name of the service I get &quot;NullService&quot;, which I<br>
assume is why it doesn&#39;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>