network: Remove semi-complex primary device finding

According to dcbw (and some updated documentation), there will
always be a 1:1 correspondence between NMActiveConnection and
an NMDevice.

https://bugzilla.gnome.org/show_bug.cgi?id=700322
This commit is contained in:
Jasper St. Pierre 2013-04-29 13:09:01 -04:00
parent 7833e21b01
commit cd9c5b9c5d

View File

@ -1946,18 +1946,10 @@ const NMApplet = new Lang.Class({
active_vpn = a; active_vpn = a;
if (!a._primaryDevice) { if (!a._primaryDevice) {
if (a._type != NetworkManager.SETTING_VPN_SETTING_NAME) { if (a._type != NetworkManager.SETTING_VPN_SETTING_NAME)
// find a good device to be considered primary // This list is guaranteed to have one device in it.
a._primaryDevice = null; a._primaryDevice = a.get_devices()[0]._delegate;
let devices = a.get_devices() || []; else
for (let j = 0; j < devices.length; j++) {
let d = devices[j];
if (d._delegate) {
a._primaryDevice = d._delegate;
break;
}
}
} else
a._primaryDevice = this._vpnSection; a._primaryDevice = this._vpnSection;
if (a._primaryDevice) if (a._primaryDevice)