declarative plasmoids and services
Alex Merry
kde at randomguy3.me.uk
Fri Apr 27 23:13:35 UTC 2012
While developing the nowplaying QML plasmoid (see previous email), I ran
into problems using services where
service.startOperationCall(service.operationDescription("Play"))
would fail ("Play" takes no arguments), because startOperationCall would
get an invalid KConfigGroup (with no name).
It turned out that this was because I was storing the service in a
QtObject property, and some sort of typing information about functions
was being lost. The solution was to always call serviceForSource() at
the point where I needed to use the service.
However, the design pattern for services is to always create a new one,
so we've either got a memory leak (if they don't go away), or
setAssociatedWidget() isn't going to work (if they do).
Brief testing suggests that setAssociated[Widget/Item]() works (subject
to https://git.reviewboard.kde.org/r/104760/). That may indicate the
leak scenario, or I may have just been (un)lucky with garbage collection.
Is this something that needs to be dealt with? Perhaps in libplasma2?
Alex
More information about the Plasma-devel
mailing list