[gnome-shell] NetworkMenu: fix handling WWAN devices



commit c7dfd0894ea6db6b1b04f723fae857ebfdf46f4f
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Sat Apr 2 22:27:20 2011 +0200

    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 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
index 90affc3..f76d5bb 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);



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