stefan pushed a commit to branch master. http://git.enlightenment.org/core/enlightenment.git/commit/?id=0ac7f90aa77841fd3ead3a0585623191b4416eeb
commit 0ac7f90aa77841fd3ead3a0585623191b4416eeb Author: Stefan Schmidt <s.schm...@samsung.com> Date: Wed Apr 22 13:54:51 2015 +0200 modules/geolocation: Make module work with newer GeoClue2 In newer GeoClue2 version, tested with 2.1.10, we need to set the DesktopId and AccurancyLevel to get a location object. --- src/modules/geolocation/e_mod_main.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/modules/geolocation/e_mod_main.c b/src/modules/geolocation/e_mod_main.c index c07f96f..4568d51 100644 --- a/src/modules/geolocation/e_mod_main.c +++ b/src/modules/geolocation/e_mod_main.c @@ -52,6 +52,8 @@ struct _Instance const char *description; }; +#define GCLUE_ACCURACY_LEVEL_EXACT 8; + static Eina_List *geolocation_instances = NULL; static E_Module *geolocation_module = NULL; @@ -278,6 +280,14 @@ cb_location_prop_description_get(void *data EINA_UNUSED, Eldbus_Pending *p EINA_ } void +cb_client_prop_set(void *data EINA_UNUSED, const char *propname EINA_UNUSED, + Eldbus_Proxy *proxy EINA_UNUSED, Eldbus_Pending *p EINA_UNUSED, + Eldbus_Error_Info *error_info EINA_UNUSED) +{ + DBG("Client %s property set callback received", propname); +} + +void cb_client_location_updated_signal(void *data, const Eldbus_Message *msg) { const char *new_path, *old_path; @@ -312,6 +322,8 @@ cb_client_object_get(Eldbus_Proxy *proxy EINA_UNUSED, void *data, Eldbus_Pending Eldbus_Error_Info *error EINA_UNUSED, const char *client_path) { Instance *inst = data; + int accuracy; + const char *desktopid; DBG("Client object path: %s", client_path); inst->client = geo_clue2_client_proxy_get(inst->conn, "org.freedesktop.GeoClue2", client_path); @@ -321,6 +333,11 @@ cb_client_object_get(Eldbus_Proxy *proxy EINA_UNUSED, void *data, Eldbus_Pending return; } + desktopid = "Enlightenment-module"; + geo_clue2_client_desktop_id_propset(inst->client, cb_client_prop_set, inst, desktopid); + accuracy = GCLUE_ACCURACY_LEVEL_EXACT; + geo_clue2_client_requested_accuracy_level_propset(inst->client, cb_client_prop_set, inst, (void*)(intptr_t)accuracy); + eldbus_proxy_signal_handler_add(inst->client, "LocationUpdated", cb_client_location_updated_signal, inst); } --