[gnome-shell] NetworkMenu: fix number of visible networks



commit aad9179373cdcda5696fbf5958c191e66a85f2eb
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Sat Nov 19 19:01:24 2011 +0100

    NetworkMenu: fix number of visible networks
    
    When placing networks in _createSection, we were taking in
    consideration that _activeNetwork is always first, by adding 1,
    but then kept this offset also for networks following it (normally,
    all of them, since _activeNetwork is also the most recently used),
    that instead should not be affected by the movement.
    This resulted in the menu showing 4 networks + More... instead of
    5.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=664124

 js/ui/status/network.js |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
index a68bd8c..fa2b8df 100644
--- a/js/ui/status/network.js
+++ b/js/ui/status/network.js
@@ -1524,8 +1524,10 @@ const NMDeviceWireless = new Lang.Class({
 
         for(let j = 0; j < this._networks.length; j++) {
             let apObj = this._networks[j];
-            if (apObj == this._activeNetwork)
+            if (apObj == this._activeNetwork) {
+                activeOffset--;
                 continue;
+            }
 
             this._createNetworkItem(apObj, j + activeOffset);
         }



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