[gnome-shell] network: fix two warnings when removing a network device
- From: Dan Winship <danw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] network: fix two warnings when removing a network device
- Date: Mon, 11 Apr 2011 14:44:25 +0000 (UTC)
commit 5b1a76aeff6fbab4fb243b8da9dab6bae57f1c63
Author: Dan Winship <danw gnome org>
Date: Mon Apr 4 08:31:55 2011 -0400
network: fix two warnings when removing a network device
NMApplet connects to each NMDevice's state-changed signal and stores
the signal handler id on the NMDevice itself. However, it was using
the same name as NMDevice itself was using to store the handler ID for
the underlying GObject's state-changed signal, thus overwriting it,
and resulting in *neither* signal handler getting removed if the
device went away. (This probably isn't a problem, since the device is
going away, but it causes a warning.)
Also, at least for WWAN devices, the device state changes to UNMANAGED
immediately before disappearing, but getStatusLabel() wasn't handling
that case and printed a warning instead. Fix that.
https://bugzilla.gnome.org/show_bug.cgi?id=646708
js/ui/status/network.js | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
index 5510272..90affc3 100644
--- a/js/ui/status/network.js
+++ b/js/ui/status/network.js
@@ -492,6 +492,7 @@ NMDevice.prototype = {
getStatusLabel: function() {
switch(this.device.state) {
+ case NetworkManager.DeviceState.UNMANAGED:
case NetworkManager.DeviceState.DISCONNECTED:
case NetworkManager.DeviceState.ACTIVATED:
return null;
@@ -1711,13 +1712,13 @@ NMApplet.prototype = {
{ icon: icon });
this._source.notify(notification);
})); */
- wrapper._stateChangedId = wrapper.connect('state-changed', Lang.bind(this, function(dev) {
+ wrapper._deviceStateChangedId = wrapper.connect('state-changed', Lang.bind(this, function(dev) {
this._syncSectionTitle(dev.category);
}));
wrapper._destroyId = wrapper.connect('destroy', function(wrapper) {
//wrapper.disconnect(wrapper._networkLostId);
//wrapper.disconnect(wrapper._activationFailedId);
- wrapper.disconnect(wrapper._stateChangedId);
+ wrapper.disconnect(wrapper._deviceStateChangedId);
});
let section = this._devices[wrapper.category].section;
let devices = this._devices[wrapper.category].devices;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]