Plasma::Service API addition

Alex Merry kde at randomguy3.me.uk
Mon May 14 10:18:43 UTC 2012


On 13/05/12 14:48, Aaron J. Seigo wrote:
> On Friday, May 11, 2012 17:29:44 Alex Merry wrote:
>> It's probably worth considering the interaction between Plasma::Service
>> and declarative applets generally.  I ran into issues with keeping
>> around an instance of Plasma::Service (I tried to keep it as a QtObject
>> property on a QML item, which didn't work), and eventually managed to
>> get it working by storing it as a variable in a separate .js file (which
>> I remembered doing in another QML project of mine).
>
> putting it in a variant roperty didn't work?

I'm not sure I actually tried that.

>> I think having a DataSource equivalent for Plasma::Service would be
>> good, and allowing things like
>>
>> Button {
>> 	text: "Open"
>> 	enabled: mprisService.commands.openUri.enabled
>> 	onClicked: mprisService.commands.openUri({url = uriEdit.text});
>> }
>>
>> or something along those lines.
>
> that would be nice, with some caveats: Service is not a push API, so the
> enabled example above would imply polling. really, that's more appropriate to
> a data engine. the onClicked example makes sense, however.

The "enabled" thing is meant to be an equivalent to associateWidget. 
That part of Service does behave like a push API (when available; for 
example, mpris2 changes the enabled states of commands when it is 
notified of a capability change by the media player).



More information about the Plasma-devel mailing list