Installing Plasma.Service *.operations file

Thomas Olsen tanghus at gmail.com
Thu Dec 23 01:31:09 CET 2010


On Thursday 23 December 2010 00:40:59 Aaron J. Seigo wrote:
> On Wednesday, December 22, 2010, Thomas Olsen wrote:
> > Except that it doesn't work until it's installed in
> > ~/.kde/share/apps/plasma/services. I thought I had messed up my code but
> > it works again after I copied it there.
> 
> no, that's quite wrong: packages should never install files outside of
> themselves ...
> 
>  bet the Python DataEngine bindings are messed up and don't check for the
> file in the "services" location.
> 
> *looks*
> 
> yes, that's it. *grumble*
> 
> the Javascript bindings have a class called JavaScriptService which does
> this:
> 
> void JavaScriptService::registerOperationsScheme()
> {
>     if (!m_dataEngine) {
>         return;
>     }
> 
>     const QString path = m_dataEngine.data()->filePath("services", name() +
> ".operations");
> 
>     if (path.isEmpty()) {
>         kDebug() << "Cannot find operations description:" << name() <<
> ".operations";
>         m_dataEngine.clear();
>         return;
>     }
> 
>     QFile file(path);
>     setOperationsScheme(&file);
> }
> 
> since the Service does not know about the DataEngine (and can't, at least
> not in a reliable fasion; it can be told about the DataEngine, but only
> after its too late .. and using the QObject hierarchy is just too error
> prone and would invalidate valid use cases where the DataEngine isn't an
> ancestor), the ScriptEngine needs to provide a service subclass that does
> as the above.
> 
> you may be able to work around that in your Python code by creating a
> Plasma::Service subclass yourself which does the above? it realy does
> belong in the Python ScriptEngine, in any case, but that's beyond my
> python mojo to do :)

Since I'm already subclassing Plasma::Service I will have a go with it. My 
brain is too tired to look at more code tonight, but I finally got it somehow 
to work, so I'll sleep on it before I mess up the code again ;-)

Thanks for looking into this.

-- 
Best regards / med venlig hilsen

Thomas Olsen

Dropbox and my thumb drive had an epic battle. Dropbox won. 
http://db.tt/T0p6d6L
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 230 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20101223/76f40f61/attachment.sig 


More information about the Plasma-devel mailing list