Commit 7f219ae0 authored by Zeeshan Ali's avatar Zeeshan Ali

locator: Map country-level accuracy to city-level

There is no source that provides country-level accuracy. Since Wifi (as
geoip) source is the best we can do, accuracy really is country-level many
times from this source and its doubtful app (or user) will mind being
given slighly more accurate location, lets just map this to city-level
accuracy.
parent 7bdce141
......@@ -400,8 +400,19 @@ gclue_locator_stop (GClueLocationSource *source)
GClueLocator *
gclue_locator_new (GClueAccuracyLevel level)
{
GClueAccuracyLevel accuracy_level = level;
if (accuracy_level == GCLUE_ACCURACY_LEVEL_COUNTRY)
/* There is no source that provides country-level accuracy.
* Since Wifi (as geoip) source is the best we can do, accuracy
* really is country-level many times from this source and its
* doubtful app (or user) will mind being given slighly more
* accurate location, lets just map this to city-level accuracy.
*/
accuracy_level = GCLUE_ACCURACY_LEVEL_CITY;
return g_object_new (GCLUE_TYPE_LOCATOR,
"accuracy-level", level,
"accuracy-level", accuracy_level,
NULL);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment