[gnome-maps] MainWindow: Check for userLocation being unset



commit 63c8da5a0d97cf502d33114380792a0f7899c0d8
Author: Jonas Danielsson <jonas threetimestwo org>
Date:   Tue Nov 25 18:56:21 2014 +0100

    MainWindow: Check for userLocation being unset

 src/mainWindow.js |   10 +---------
 src/mapView.js    |    3 +++
 2 files changed, 4 insertions(+), 9 deletions(-)
---
diff --git a/src/mainWindow.js b/src/mainWindow.js
index 30455ae..0e44904 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -287,15 +287,7 @@ const MainWindow = new Lang.Class({
     },
 
     _onGotoUserLocationActivate: function() {
-        if (Application.geoclue.userSetLocation) {
-            Utils.once(Application.geoclue,
-                       'location-changed',
-                       (function() {
-                this.mapView.gotoUserLocation(true);
-            }).bind(this));
-            Application.geoclue.findLocation();
-        } else
-            this.mapView.gotoUserLocation(true);
+        this.mapView.gotoUserLocation(true);
     },
 
     _onMapTypeMenuActivate: function(action) {
diff --git a/src/mapView.js b/src/mapView.js
index bc40b95..dd3e0a6 100644
--- a/src/mapView.js
+++ b/src/mapView.js
@@ -146,6 +146,9 @@ const MapView = new Lang.Class({
     },
 
     gotoUserLocation: function(animate) {
+        if (!this._userLocation)
+            return;
+
         this.emit('going-to-user-location');
         Utils.once(this._userLocation, "gone-to", (function() {
             this.emit('gone-to-user-location');


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