GNOME Bugzilla – Bug 677268
Utilities for timezone lookup
Last modified: 2014-02-18 23:48:15 UTC
While trying to add geoclue integration to find the nearest timezone to a user, I found I couldn't easily do what I wanted to do without hacking up libgweather itself, so here we are... Maybe I missed something entirely.
Created attachment 215406 [details] [review] location: Make the distance calculation function public Sometimes it might be necessary to get the distances between two locations, or between a GWeatherLocation and a latitude/longitude coordinate pair.
Created attachment 215407 [details] [review] location: Add a utility function to find the nearest city to a coordinate
Review of attachment 215407 [details] [review]: ::: libgweather/gweather-location.c @@ +515,3 @@ + + append_cities (world, &cities); + Hmm, does gweather_location_new_world parse the xml database every time ? Might be nicer to pass that in, so that the caller can hold onto it instead of recreating it every single time ? Also, you could do a foreach_location() with a callback, instead of allocating the list of cities just to iterate over it. @@ +537,3 @@ + gweather_location_ref (min_loc); + gweather_location_unref (world); + Looks like you are leaking the list of cities here ?
Review of attachment 215406 [details] [review]: Do you actually need this as public API ? The gnome-initial-setup code only seems to use the find_nearest api in the next patch...
Created attachment 216150 [details] [review] location: Add a utility function to find the nearest city to a coordinate Yeah, we don't need the public distance function.
Seems you forgot to close the bug.