[gnome-weather] CurrentLocationController: create a detached location from geoclue
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-weather] CurrentLocationController: create a detached location from geoclue
- Date: Mon, 16 Feb 2015 06:10:42 +0000 (UTC)
commit 0025bb70ce30fefed7cf363c4d888f136c2ae284
Author: Giovanni Campagna <scampa giovanni gmail com>
Date: Sun Feb 15 21:52:56 2015 -0800
CurrentLocationController: create a detached location from geoclue
This allows more accurate weather reporting, because we use the
exact coordinates obtained from Geoclue.
Also remove silly geocode-glib usage.
src/app/currentLocationController.js | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/src/app/currentLocationController.js b/src/app/currentLocationController.js
index f6db793..752b9bc 100644
--- a/src/app/currentLocationController.js
+++ b/src/app/currentLocationController.js
@@ -20,7 +20,6 @@ const GLib = imports.gi.GLib;
const Gio = imports.gi.Gio;
const Lang = imports.lang;
const GWeather = imports.gi.GWeather;
-const Geocode = imports.gi.GeocodeGlib;
const Util = imports.misc.util;
@@ -134,12 +133,11 @@ const CurrentLocationController = new Lang.Class({
let geoclueLocation = new LocationProxy(Gio.DBus.system,
"org.freedesktop.GeoClue2",
newPath);
- let location = new Geocode.Location({ latitude: geoclueLocation.Latitude,
- longitude: geoclueLocation.Longitude,
- accuracy: geoclueLocation.Accuracy,
- description: geoclueLocation.Description });
- this.currentLocation = GWeather.Location.get_world().find_nearest_city (location.latitude,
location.longitude);
+ this.currentLocation = GWeather.Location.new_detached(geoclueLocation.Description,
+ null,
+ geoclueLocation.Latitude,
+ geoclueLocation.Longitude);
this._world.currentLocationChanged(this.currentLocation);
},
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]