[gnome-shell] NetworkMenu: fix wireless-enabled property notifications



commit 8a8b3bf96e22c1da35fc9bb6203d3d40c08653ac
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Tue Oct 8 21:23:30 2013 +0200

    NetworkMenu: fix wireless-enabled property notifications
    
    The property is on the NMClient, not NMDevice. Also, make sure
    we disconnect the signal when the item is destroyed.
    Also, connect to wireless-hardware-enabled, which we'll use soon.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=709635

 js/ui/status/network.js |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
index 6a2efc9..26aa816 100644
--- a/js/ui/status/network.js
+++ b/js/ui/status/network.js
@@ -971,7 +971,8 @@ const NMDeviceWireless = new Lang.Class({
 
         this.item.menu.addSettingsAction(_("Network Settings"), 'gnome-network-panel.desktop');
 
-        this._wirelessEnabledChangedId = this._device.connect('notify::wireless-enabled', Lang.bind(this, 
this._sync));
+        this._wirelessEnabledChangedId = this._client.connect('notify::wireless-enabled', Lang.bind(this, 
this._sync));
+        this._wirelessHwEnabledChangedId = this._client.connect('notify::wireless-hardware-enabled', 
Lang.bind(this, this._sync));
         this._activeApChangedId = this._device.connect('notify::active-access-point', Lang.bind(this, 
this._activeApChanged));
         this._stateChangedId = this._device.connect('state-changed', Lang.bind(this, 
this._deviceStateChanged));
 
@@ -991,6 +992,14 @@ const NMDeviceWireless = new Lang.Class({
             this._activeAccessPoint.disconnect(this._strengthChangedId);
             this._strengthChangedId = 0;
         }
+        if (this._wirelessEnabledChangedId) {
+            this._client.disconnect(this._wirelessEnabledChangedId);
+            this._wirelessEnabledChangedId = 0;
+        }
+        if (this._wirelessHwEnabledChangedId) {
+            this._client.disconnect(this._wirelessHwEnabledChangedId);
+            this._wirelessHwEnabledChangedId = 0;
+        }
 
         this.item.destroy();
     },


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