[gnome-shell/wip/aggregate-menu: 37/69] network: Fix the AP strength indicator never getting updated



commit ddb043a63c9e5414499453923e33ae281c350865
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Jul 16 17:46:09 2013 -0400

    network: Fix the AP strength indicator never getting updated
    
    I intended to make a few code cleanups, but I apparently forgot
    to hook up _updateAccessPoint. Merge it with _activeApChanged,
    which is where the notify::active-access-point signal is actually
    hooked up to.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=704670

 js/ui/status/network.js |   47 ++++++++++++++++++-----------------------------
 1 files changed, 18 insertions(+), 29 deletions(-)
---
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
index 221863b..94da4bb 100644
--- a/js/ui/status/network.js
+++ b/js/ui/status/network.js
@@ -806,18 +806,31 @@ const NMDeviceWireless = new Lang.Class({
     },
 
     _activeApChanged: function() {
-        this._activeNetwork = null;
+        let ap = this._device.active_access_point;
+        if (this._activeAccessPoint == ap)
+            return;
 
-        let activeAp = this._device.active_access_point;
+        if (this._activeAccessPoint) {
+            this._activeAccessPoint.disconnect(this._strengthChangedId);
+            this._strengthChangedId = 0;
+        }
 
-        if (activeAp) {
-            let res = this._findExistingNetwork(activeAp);
+        this._activeAccessPoint = ap;
 
+        if (this._activeAccessPoint) {
+            this._strengthChangedId = this._activeAccessPoint.connect('notify::strength',
+                                                                      Lang.bind(this, 
this._strengthChanged));
+
+            let res = this._findExistingNetwork(activeAp);
             if (res != null)
                 this._activeNetwork = this._networks[res.network];
         }
 
-        // we don't refresh the view here, _activeConnectionChanged will
+        this.emit('icon-changed');
+    },
+
+    _strengthChanged: function() {
+        this.emit('icon-changed');
     },
 
     _getApSecurityType: function(accessPoint) {
@@ -1217,30 +1230,6 @@ const NMDeviceWireless = new Lang.Class({
         }
     },
 
-    _updateAccessPoint: function() {
-        let ap = this._device.active_access_point;
-        if (this._activeAccessPoint == ap)
-            return;
-
-        if (this._activeAccessPoint) {
-            this._activeAccessPoint.disconnect(this._strengthChangedId);
-            this._strengthChangedId = 0;
-        }
-
-        this._activeAccessPoint = ap;
-
-        if (this._activeAccessPoint) {
-            this._strengthChangedId = this._activeAccessPoint.connect('notify::strength',
-                                                                      Lang.bind(this, 
this._strengthChanged));
-        }
-
-        this._syncStatusLabel();
-    },
-
-    _strengthChanged: function() {
-        this.emit('icon-changed');
-    },
-
     getIndicatorIcon: function() {
         if (this._device.active_connection.state == NetworkManager.ActiveConnectionState.ACTIVATING)
             return 'network-wireless-acquiring-symbolic';


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