On Saturday 15 August 2009, alan moore wrote:
> Hello; I am working on my first plasmoid (in Python), so apologies in
> advance if I'm a blockhead.
>
> I'm trying to remake the old kicker dictionary applet.  I have code that
> works by calling the "dict" CLI command, but naturally I want to switch
> that to working with a data engine.  I'm a bit hazy on how to
> communicate with the dict dataEngine and get what I want from it;
> specifically:
>
>   - How do I tell it what server/dictionary to use?  I saw there is a
> setServer() function in the code, but it's private.

i don't believe there is a way to do this currently. it could be done in a few 
ways:

* the source name could be the server, though that's not backwards compatible

* there could be a serviceForSource that returns a service that lets one 
define what the server(s) to use for that word should be.

the latter is probably the way to go. it requires a bit of work to the dict 
dataengine in kdebase, but wouldn't be too difficult. other engines implement 
serviceForSource as well, so examples abound :)

> I also tried using connectSource(), then assigning mydef in dataUpdated.
>   I noticed in that case that I first got an empty dictionary, then a
> few moments later the actual data I was looking for.

that's correct; the process is asynchronous so it will update later. there is 
no way around that unless we make the entire internet synchronous ;)

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Software

Attachment: signature.asc
Description: This is a digitally signed message part.

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

Reply via email to