[gnome-weather/gnome-3-34] Revert "Revert "app: Use find_nearest_city() instead of new_detached()""



commit a397c86ee0715ccc929f67a391ce943e4d937e33
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Thu Apr 9 19:35:12 2020 -0500

    Revert "Revert "app: Use find_nearest_city() instead of new_detached()""
    
    This reverts commit 1efc471d9c34be9453b5e457fdebd973f5da632d.
    
    This broke location autodetection. Detached locations have no weather
    forecast available.
    
    There's nothing wrong with this commit. Using the nearest city is the
    right thing to do when autodetecting location. I reverted this only
    because it was committed in tandem with 49e6a52a, which really does need
    to stay reverted. But this one is fine.
    
    Fixes #95

 src/app/currentLocationController.js | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/app/currentLocationController.js b/src/app/currentLocationController.js
index 67538d2..644ac63 100644
--- a/src/app/currentLocationController.js
+++ b/src/app/currentLocationController.js
@@ -87,10 +87,11 @@ var CurrentLocationController = class CurrentLocationController {
     _onLocationUpdated(simple) {
         let geoclueLocation = simple.get_location();
 
-        this.currentLocation = GWeather.Location.new_detached(geoclueLocation.description,
-                                                              null,
-                                                              geoclueLocation.latitude,
-                                                              geoclueLocation.longitude);
+        this.currentLocation = GWeather.Location.get_world()
+                                                .find_nearest_city(
+                                                    geoclueLocation.latitude,
+                                                    geoclueLocation.longitude
+                                                );
         this._world.currentLocationChanged(this.currentLocation);
     }
 


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