[gnome-maps] geoclue: Remove last-location settings



commit 9d42897491faa7807aceb09b750333608e93d1c9
Author: Jonas Danielsson <jonas threetimestwo org>
Date:   Mon Dec 1 06:50:04 2014 -0500

    geoclue: Remove last-location settings

 data/org.gnome.maps.gschema.xml.in |   10 ----------
 src/geoclue.js                     |   24 ++++--------------------
 2 files changed, 4 insertions(+), 30 deletions(-)
---
diff --git a/data/org.gnome.maps.gschema.xml.in b/data/org.gnome.maps.gschema.xml.in
index adc8b5c..d118207 100644
--- a/data/org.gnome.maps.gschema.xml.in
+++ b/data/org.gnome.maps.gschema.xml.in
@@ -15,16 +15,6 @@
       <_summary>Window maximized</_summary>
       <_description>Window maximization state</_description>
     </key>
-    <key name="last-location" type="ad">
-      <default>[40.71455, -74.007118, 1000.0]</default>
-      <_summary>Last known location and accuracy</_summary>
-      <_description>Last known location (latitude and longitude in degrees) and accuracy (in 
meters).</_description>
-    </key>
-    <key name="last-location-description" type="s">
-      <default>"New York City, New York, USA"</default>
-      <_summary>Description of last known location</_summary>
-      <_description>Description of last known location of user.</_description>
-    </key>
     <key name="max-search-results" type="i">
       <default>100</default>
       <_summary>Maximum number of search results</_summary>
diff --git a/src/geoclue.js b/src/geoclue.js
index 2d07da9..e58674d 100644
--- a/src/geoclue.js
+++ b/src/geoclue.js
@@ -101,19 +101,7 @@ const Geoclue = new Lang.Class({
     _init: function() {
         this.parent();
         this.connected = false;
-
-        let lastLocation = Application.settings.get('last-location');
-        if (lastLocation.length >= 3) {
-            let [lat, lng, accuracy] = lastLocation;
-            let lastLocationDescription = Application.settings.get('last-location-description');
-
-            let location = new Geocode.Location({ latitude: lat,
-                                                  longitude: lng,
-                                                  accuracy: accuracy });
-
-            this.place = new Geocode.Place({ location: location,
-                                             name: _("Current location") });
-        }
+        this.place = null;
 
         try {
             this._managerProxy = new ManagerProxy(Gio.DBus.system,
@@ -167,14 +155,10 @@ const Geoclue = new Lang.Class({
     },
 
     _updateLocation: function(location) {
-        this.place.location = location;
-
-        Application.settings.set('last-location', [location.latitude,
-                                                   location.longitude,
-                                                   location.accuracy]);
-        if (location.description !== null)
-            Application.settings.set('last-location-description', location.description);
+        if (!this.place)
+            this.place = new Geocode.Place();
 
+        this.place.location = location;
         this.emit('location-changed');
         Utils.debug("Updated location: " + location.description);
     }


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