[gnome-maps] userLocationMarker: Use bound view properties



commit f5655b7f6480d3337c7873c2c3936e356fd67858
Author: Marcus Lundblad <ml update uu se>
Date:   Wed Feb 14 22:55:23 2018 +0100

    userLocationMarker: Use bound view properties
    
    Instead of manually disconnecting view signal handlers,
    connect to the bound properties.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=793472

 src/mapView.js            |    4 +---
 src/userLocationMarker.js |    7 +------
 2 files changed, 2 insertions(+), 9 deletions(-)
---
diff --git a/src/mapView.js b/src/mapView.js
index db109f6..0e05c60 100644
--- a/src/mapView.js
+++ b/src/mapView.js
@@ -424,10 +424,8 @@ var MapView = GObject.registerClass({
         }
 
         let place = Application.geoclue.place;
-
         let previousSelected = this._userLocation && this._userLocation.selected;
-        if (this._userLocation)
-            this._userLocation.disconnectView();
+
         this._userLocation = new UserLocationMarker.UserLocationMarker({ place: place,
                                                                          mapView: this });
         this._userLocationLayer.remove_all();
diff --git a/src/userLocationMarker.js b/src/userLocationMarker.js
index a66c07d..4285cd0 100644
--- a/src/userLocationMarker.js
+++ b/src/userLocationMarker.js
@@ -79,7 +79,7 @@ class UserLocationMarker extends MapMarker.MapMarker {
         if (this.place.location.accuracy > 0) {
             this._accuracyMarker = new AccuracyCircleMarker({ place: this.place });
             this._accuracyMarker.refreshGeometry(this._view);
-            this._zoomLevelId = this._view.connect('notify::zoom-level',
+            this._zoomLevelId = this._view.connect('notify::view-zoom-level',
                                                    
this._accuracyMarker.refreshGeometry.bind(this._accuracyMarker));
         }
     }
@@ -100,9 +100,4 @@ class UserLocationMarker extends MapMarker.MapMarker {
 
         layer.add_marker(this);
     }
-
-    disconnectView() {
-        if (this._zoomLevelId)
-            this._view.disconnect(this._zoomLevelId);
-    }
 });


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