[gnome-calendar/wip/flb/weather-forecast: 114/135] weather: Use find_nearest_city instead of new_detached



commit 9d4bf09ca77cee91e857dc96587e1443d9d70942
Author: Florian Brosch <flo brosch gmail com>
Date:   Sun Oct 15 21:58:57 2017 +0200

    weather: Use find_nearest_city instead of new_detached

 src/gcal-weather-service.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/gcal-weather-service.c b/src/gcal-weather-service.c
index 63932193..9ed78eee 100644
--- a/src/gcal-weather-service.c
+++ b/src/gcal-weather-service.c
@@ -957,13 +957,17 @@ gcal_weather_service_update_gclue_location (GcalWeatherService  *self,
       loc_name = gcal_weather_service_get_location_name (location);
       if (loc_name != NULL)
         {
+          GWeatherLocation *wworld; /* unowned */
           gdouble latitude;
           gdouble longitude;
 
           latitude = gclue_location_get_latitude (location);
           longitude = gclue_location_get_longitude (location);
 
-          wlocation = gweather_location_new_detached (loc_name, NULL, latitude, longitude);
+          // wlocation = gweather_location_new_detached (loc_name, NULL, latitude, longitude);
+          // nearest-city works more closely to gnome weather.
+          wworld = gweather_location_get_world ();
+          wlocation = gweather_location_find_nearest_city (wworld, latitude, longitude);
         }
     }
 


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