[gnome-shell/wip/message-tray-menu: 89/109] network: Remove semi-complex primary device finding
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/message-tray-menu: 89/109] network: Remove semi-complex primary device finding
- Date: Thu, 9 May 2013 15:43:49 +0000 (UTC)
commit 818b9e500e4ad53bbfb34a90c7ff33cd969e2802
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Mon Apr 29 13:09:01 2013 -0400
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.
js/ui/status/network.js | 16 ++++------------
1 files changed, 4 insertions(+), 12 deletions(-)
---
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
index 6b7c9fa..4d6fe64 100644
--- a/js/ui/status/network.js
+++ b/js/ui/status/network.js
@@ -1944,18 +1944,10 @@ const NMApplet = new Lang.Class({
active_vpn = a;
if (!a._primaryDevice) {
- if (a._type != NetworkManager.SETTING_VPN_SETTING_NAME) {
- // find a good device to be considered primary
- a._primaryDevice = null;
- let devices = a.get_devices() || [];
- for (let j = 0; j < devices.length; j++) {
- let d = devices[j];
- if (d._delegate) {
- a._primaryDevice = d._delegate;
- break;
- }
- }
- } else
+ if (a._type != NetworkManager.SETTING_VPN_SETTING_NAME)
+ // This list is guaranteed to have one device in it.
+ a._primaryDevice = a.get_devices()[0]._delegate;
+ else
a._primaryDevice = this._vpnSection;
if (a._primaryDevice)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]