[gnome-maps] geoclue: Convert location property to place



commit 24b2f985aa2190ca3887a32f37ec248c7379271d
Author: Jonas Danielsson <jonas danielsson threetimestwo org>
Date:   Thu Oct 30 07:17:09 2014 -0400

    geoclue: Convert location property to place

 src/geoclue.js |   13 ++++++++-----
 src/mapView.js |   11 ++---------
 2 files changed, 10 insertions(+), 14 deletions(-)
---
diff --git a/src/geoclue.js b/src/geoclue.js
index 66106db..bd4816a 100644
--- a/src/geoclue.js
+++ b/src/geoclue.js
@@ -125,11 +125,14 @@ const Geoclue = new Lang.Class({
         let lastLocation = Application.settings.get('last-location');
         if (lastLocation.length >= 3) {
             let [lat, lng, accuracy] = lastLocation;
-            this.location = new Geocode.Location({ latitude: lat,
-                                                   longitude: lng,
-                                                   accuracy: accuracy });
             let lastLocationDescription = Application.settings.get('last-location-description');
-            this.location.set_description(lastLocationDescription);
+
+            let location = new Geocode.Location({ latitude: lat,
+                                                  longitude: lng,
+                                                  accuracy: accuracy });
+
+            this.place = new Geocode.Place({ location: location });
+
             this.userSetLocation = Application.settings.get('last-location-user-set');
         }
 
@@ -177,7 +180,7 @@ const Geoclue = new Lang.Class({
     },
 
     _updateLocation: function(location, userSet) {
-        this.location = location;
+        this.place.location = location;
 
         Application.settings.set('last-location', [location.latitude,
                                                    location.longitude,
diff --git a/src/mapView.js b/src/mapView.js
index b24e00c..7d9047e 100644
--- a/src/mapView.js
+++ b/src/mapView.js
@@ -160,17 +160,10 @@ const MapView = new Lang.Class({
     },
 
     _updateUserLocation: function() {
-        if (!Application.geoclue)
+        if (!Application.geoclue || !Application.geoclue.place)
             return;
 
-        let location = Application.geoclue.location;
-
-        if (!location)
-            return;
-
-        let place = Geocode.Place.new_with_location(location.description,
-                                                    Geocode.PlaceType.UNKNOWN,
-                                                    location);
+        let place = Application.geoclue.place;
 
         let previousSelected = this._userLocation && this._userLocation.selected;
         this._userLocation = new UserLocationMarker.UserLocationMarker({ place: place,


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