[gnome-weather/wip/christopherdavis/use-find-nearest-city-instead-of-detached: 4/5] app: Use find_nearest_city() instead of new_detached()
- From: Christopher Davis <christopherdavis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-weather/wip/christopherdavis/use-find-nearest-city-instead-of-detached: 4/5] app: Use find_nearest_city() instead of new_detached()
- Date: Sun, 31 Mar 2019 05:22:43 +0000 (UTC)
commit e8ba9a1eefa41f310a5e748a68ef7caef9dbf217
Author: Christopher Davis <brainblasted disroot org>
Date: Tue Mar 19 15:20:41 2019 -0700
app: Use find_nearest_city() instead of new_detached()
GWeather.Location.new_detached() can return a value that
cannot be serialized after being serialized.
We can use find_nearest_city() in place of it for now.
Fixes https://gitlab.gnome.org/GNOME/gnome-weather/issues/25
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]