Availability of action when using ActivateAction


In Maps I have implemented sharing of locations. So that I can share a
location to Weather and Clocks. I do this by using the
org.freedesktop.Application.ActivateAction method.

(cast of the functionality:

For Weather I activate 'show-location' and for Clocks I activate
'add-location' with my location
as a parameter.

Right now I determine if the application is available for sharing by
checking if I can get an g_desktop_app_info for the APPID.

The problem is I don't know how to check if the actual action is
implemented. For Clocks I added the action at the same time that I
added the functionality to Maps. So if a user has a newer version of
Maps than Clocks, Maps will happily say that you can share to Clocks
but the action will silently fail. If we treat the release of GNOME
apps as one joint release this is not a big big issue since having
3.16 of Maps would mean that we expect the user to have 3.16 of Clocks
as well.
But it would feel better for me if there were some way for me to
verify that the action is there.

On Irc Ryan suggested using the Implements= key of the desktop file.
But what interface should I use? Implements=share-location? And then
check for that interface in Maps?

Suggestions welcome

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]