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



commit 4280a19dadc3d6e827235ac22ecffcbdb6bfb83b
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 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/gcal-weather-service.c b/src/gcal-weather-service.c
index 6393219..9ed78ee 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]