[gnome-shell] network: Reformat connection code
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] network: Reformat connection code
- Date: Thu, 6 Jun 2013 19:33:08 +0000 (UTC)
commit aee7cd73c4baf970fa1af2e14c2adfb45e99333f
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.
https://bugzilla.gnome.org/show_bug.cgi?id=701755
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 d63245e..06317bb 100644
--- a/js/ui/status/network.js
+++ b/js/ui/status/network.js
@@ -1943,19 +1943,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 {
+ let devices = this._devices[section].devices;
+ for (let i = 0; i < devices.length; i++)
+ devices[i].removeConnection(connection);
}
connection.disconnect(connection._removedId);
@@ -1971,6 +1972,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)
@@ -1990,11 +1994,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]