[gnome-maps] Also cache accuracy of location
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps] Also cache accuracy of location
- Date: Wed, 3 Apr 2013 23:48:20 +0000 (UTC)
commit b5a981c34ab248fdcb93066a086f1ef446790b34
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Thu Apr 4 02:47:08 2013 +0300
Also cache accuracy of location
data/org.gnome.maps.gschema.xml.in | 6 +++---
src/mapView.js | 7 +++----
2 files changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/data/org.gnome.maps.gschema.xml.in b/data/org.gnome.maps.gschema.xml.in
index f902d4d..2ac23bf 100644
--- a/data/org.gnome.maps.gschema.xml.in
+++ b/data/org.gnome.maps.gschema.xml.in
@@ -16,9 +16,9 @@
<_description>Window maximized state</_description>
</key>
<key name="last-location" type="ad">
- <default>[40.71455, -74.007118]</default>
- <_summary>Last known location</_summary>
- <_description>Last known location of user (latitude and longitude in degrees).</_description>
+ <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>
diff --git a/src/mapView.js b/src/mapView.js
index 08059f2..3f3c3d3 100644
--- a/src/mapView.js
+++ b/src/mapView.js
@@ -80,12 +80,11 @@ const MapView = new Lang.Class({
if (lastLocation.n_children() == 2) {
let lat = lastLocation.get_child_value(0);
let lng = lastLocation.get_child_value(1);
+ let accuracy = lastLocation.get_child_value(2);
- // FIXME: We should keep the accuracy cached too but this type is soon going to change
- // from an enum to a double in geocode-glib so lets do it after that happens.
let location = new Geocode.Location({ latitude: lat.get_double(),
longitude: lng.get_double(),
- accuracy: Geocode.LOCATION_ACCURACY_CITY });
+ accuracy: accuracy.get_double() });
let lastLocationDescription = Application.settings.get_string('last-location-description');
location.set_description(lastLocationDescription);
@@ -101,7 +100,7 @@ const MapView = new Lang.Class({
this._gotoLocation(location, true);
- let variant = GLib.Variant.new('ad', [location.latitude, location.longitude]);
+ let variant = GLib.Variant.new('ad', [location.latitude, location.longitude,
location.accuracy]);
Application.settings.set_value('last-location', variant);
Application.settings.set_string('last-location-description', location.description);
} catch (e) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]