[gnome-shell/wip/aggregate-menu: 18/36] network: Reformat connection code
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/aggregate-menu: 18/36] network: Reformat connection code
- Date: Wed, 29 May 2013 20:17:46 +0000 (UTC)
commit e1e3fdca40ff7cb8bbbfe6eded75984fd9672229
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Wed May 22 17:35:29 2013 -0400
network: Reformat connection code
This makes the code flow the same between removeConnection and checkConnection.
js/ui/status/network.js | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
index 72b514a..e7367a1 100644
--- a/js/ui/status/network.js
+++ b/js/ui/status/network.js
@@ -1941,19 +1941,20 @@ const NMApplet = new Lang.Class({
let section = connection._section;
- if (section == NMConnectionCategory.VPN) {
- this._vpnSection.removeConnection(connection);
- } else if (section != NMConnectionCategory.INVALID) {
- let devices = this._devices[section].devices;
- for (let i = 0; i < devices.length; i++)
- devices[i].removeConnection(connection);
- }
+ if (section == NMConnectionCategory.INVALID)
+ return;
if (section == NMConnectionCategory.VIRTUAL) {
let iface = connection.get_virtual_iface_name();
let wrapper = this._findVirtualDevice(iface);
if (wrapper && !wrapper.hasConnections())
this._removeDeviceWrapper(wrapper);
+ } else if (section == NMConnectionCategory.VPN) {
+ this._vpnSection.removeConnection(connection);
+ } else if (section != NMConnectionCategory.INVALID) {
+ let devices = this._devices[section].devices;
+ for (let i = 0; i < devices.length; i++)
+ devices[i].removeConnection(connection);
}
connection.disconnect(connection._removedId);
@@ -1969,6 +1970,9 @@ const NMApplet = new Lang.Class({
let section = connection._section;
+ if (section == NMConnectionCategory.INVALID)
+ return;
+
if (section == NMConnectionCategory.VIRTUAL) {
let wrapperClass = this._vtypes[connection._type];
if (!wrapperClass)
@@ -1988,11 +1992,7 @@ const NMApplet = new Lang.Class({
break;
}
}
- }
-
- if (section == NMConnectionCategory.INVALID)
- return;
- if (section == NMConnectionCategory.VPN) {
+ } else if (section == NMConnectionCategory.VPN) {
this._vpnSection.checkConnection(connection);
} else {
let devices = this._devices[section].devices;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]