From c7dfd0894ea6db6b1b04f723fae857ebfdf46f4f Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Sat, 2 Apr 2011 22:27:20 +0200 Subject: [PATCH] NetworkMenu: fix handling WWAN devices NMDeviceModem._createSection was not checking whether it should have shown the connection list, resulting in status item shown even if the device was in an invalid state. Also, fix a logic error when creating the operatorItem and fix overriding _clearSection protected method. https://bugzilla.gnome.org/show_bug.cgi?id=646395 --- js/ui/status/network.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/ui/status/network.js b/js/ui/status/network.js index 90affc3eb..f76d5bbb3 100644 --- a/js/ui/status/network.js +++ b/js/ui/status/network.js @@ -824,12 +824,15 @@ NMDeviceModem.prototype = { }, _createSection: function() { + if (!this._shouldShowConnectionList()) + return; + if (this.mobileDevice) { // If operator_name is null, just pass the empty string, as the item is hidden anyway this._operatorItem = new PopupMenu.PopupImageMenuItem(this.mobileDevice.operator_name || '', this._getSignalIcon(), { reactive: false }); - if (this.mobileDevice.operator_name) + if (!this.mobileDevice.operator_name) this._operatorItem.actor.hide(); this.section.addMenuItem(this._operatorItem); } @@ -837,7 +840,7 @@ NMDeviceModem.prototype = { NMDevice.prototype._createSection.call(this); }, - clearSection: function() { + _clearSection: function() { this._operatorItem = null; NMDevice.prototype._clearSection.call(this);