forked from enlightenment/enlightenment
modules/geolocation: Keep track of accuracy and set lower minimal value
Instead of setting the highest accuracy level as minimum we now set the lowest level. By doing so we should get a somewhat accurate location in any case. Before this change we would just not get any location information at all which was confusing and let people think the module did not work. We also keep track of the AvailableAccuracyLevel property know. Fixes T2641
This commit is contained in:
parent
53900d184a
commit
3e8a6e7127
|
@ -40,6 +40,7 @@ struct _Instance
|
||||||
Evas_Object *popup_accuracy;
|
Evas_Object *popup_accuracy;
|
||||||
Evas_Object *popup_description;
|
Evas_Object *popup_description;
|
||||||
int in_use;
|
int in_use;
|
||||||
|
int available_accur_level;
|
||||||
Eldbus_Connection *conn;
|
Eldbus_Connection *conn;
|
||||||
Eldbus_Service_Interface *iface;
|
Eldbus_Service_Interface *iface;
|
||||||
Eldbus_Proxy *manager;
|
Eldbus_Proxy *manager;
|
||||||
|
@ -52,6 +53,11 @@ struct _Instance
|
||||||
const char *description;
|
const char *description;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define GCLUE_ACCURACY_LEVEL_NONE 0;
|
||||||
|
#define GCLUE_ACCURACY_LEVEL_COUNTRY 1;
|
||||||
|
#define GCLUE_ACCURACY_LEVEL_CITY 4;
|
||||||
|
#define GCLUE_ACCURACY_LEVEL_NEIGHBORHOOD 5;
|
||||||
|
#define GCLUE_ACCURACY_LEVEL_STREET 6;
|
||||||
#define GCLUE_ACCURACY_LEVEL_EXACT 8;
|
#define GCLUE_ACCURACY_LEVEL_EXACT 8;
|
||||||
|
|
||||||
static Eina_List *geolocation_instances = NULL;
|
static Eina_List *geolocation_instances = NULL;
|
||||||
|
@ -327,7 +333,7 @@ cb_client_object_get(Eldbus_Proxy *proxy EINA_UNUSED, void *data, Eldbus_Pending
|
||||||
|
|
||||||
desktopid = "Enlightenment-module";
|
desktopid = "Enlightenment-module";
|
||||||
geo_clue2_client_desktop_id_propset(inst->client, cb_client_prop_set, inst, desktopid);
|
geo_clue2_client_desktop_id_propset(inst->client, cb_client_prop_set, inst, desktopid);
|
||||||
accuracy = GCLUE_ACCURACY_LEVEL_EXACT;
|
accuracy = GCLUE_ACCURACY_LEVEL_NONE;
|
||||||
geo_clue2_client_requested_accuracy_level_propset(inst->client, cb_client_prop_set, inst, (void*)(intptr_t)accuracy);
|
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);
|
eldbus_proxy_signal_handler_add(inst->client, "LocationUpdated", cb_client_location_updated_signal, inst);
|
||||||
|
@ -357,6 +363,14 @@ cb_manager_props_changed(void *data, Eldbus_Proxy *proxy EINA_UNUSED, void *even
|
||||||
else
|
else
|
||||||
edje_object_signal_emit(inst->icon, "e,state,location_off", "e");
|
edje_object_signal_emit(inst->icon, "e,state,location_off", "e");
|
||||||
}
|
}
|
||||||
|
if (strcmp(ev->name, "AvailableAccuracyLevel") == 0)
|
||||||
|
{
|
||||||
|
eina_value_setup(&v, EINA_VALUE_TYPE_INT);
|
||||||
|
eina_value_convert(ev->value, &v);
|
||||||
|
eina_value_get(&v, &val);
|
||||||
|
inst->available_accur_level = val;
|
||||||
|
DBG("Manager AvailableAccuracyLevel property changed to %i", inst->available_accur_level);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static E_Gadcon_Client *
|
static E_Gadcon_Client *
|
||||||
|
|
Loading…
Reference in New Issue