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
This commit is contained in:
Giovanni Campagna 2011-11-19 19:01:24 +01:00
parent d5b4e30eb7
commit aad9179373

View File

@ -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);
}