[gnome-shell/wip/message-tray-menu: 92/109] network: Remove _createAPItem
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/message-tray-menu: 92/109] network: Remove _createAPItem
- Date: Thu, 9 May 2013 15:44:05 +0000 (UTC)
commit 1532dce57df4db3ac405281d421facaf920bc970
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Thu Apr 25 20:39:19 2013 -0400
network: Remove _createAPItem
The code flows better if this is inlined like this.
https://bugzilla.gnome.org/show_bug.cgi?id=698918
js/ui/status/network.js | 29 ++++++++++++-----------------
1 files changed, 12 insertions(+), 17 deletions(-)
---
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
index d86f61b..62c6b05 100644
--- a/js/ui/status/network.js
+++ b/js/ui/status/network.js
@@ -1143,21 +1143,6 @@ const NMDeviceWireless = new Lang.Class({
}
},
- _createAPItem: function(connection, accessPointObj) {
- let item = new NMNetworkMenuItem(accessPointObj.accessPoints[0]);
- item._connection = connection;
- item.connect('activate', Lang.bind(this, function() {
- let accessPoints = accessPointObj.accessPoints;
- for (let i = 0; i < accessPoints.length; i++) {
- if (accessPoints[i].connection_valid(connection)) {
- this._client.activate_connection(connection, this.device, accessPoints[i].dbus_path,
null);
- break;
- }
- }
- }));
- return item;
- },
-
_clearSection: function() {
this.parent();
@@ -1254,10 +1239,20 @@ const NMDeviceWireless = new Lang.Class({
return;
}
+ network.item = new NMNetworkMenuItem(network.accessPoints[0]);
if(network.connections.length > 0) {
- network.item = this._createAPItem(network.connections[0], network);
+ let connection = network.connections[0];
+ network.item._connection = connection;
+ network.item.connect('activate', Lang.bind(this, function() {
+ let accessPoints = network.accessPoints;
+ for (let i = 0; i < accessPoints.length; i++) {
+ if (accessPoints[i].connection_valid(connection)) {
+ this._client.activate_connection(connection, this.device, accessPoints[i].dbus_path,
null);
+ break;
+ }
+ }
+ }));
} else {
- network.item = new NMNetworkMenuItem(network.accessPoints[0]);
network.item.connect('activate', Lang.bind(this, function() {
let accessPoints = network.accessPoints;
if ( (accessPoints[0]._secType == NMAccessPointSecurity.WPA2_ENT)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]