network: always coerce the SSID to _something_

https://bugzilla.gnome.org/show_bug.cgi?id=654898
This commit is contained in:
Rui Matos 2011-08-03 19:05:53 +01:00
parent 6a3130e25f
commit 60b54c0052

View File

@ -102,6 +102,13 @@ function sortAccessPoints(accessPoints) {
}); });
} }
function ssidToLabel(ssid) {
let label = NetworkManager.utils_ssid_to_utf8(ssid);
if (!label)
label = _("<unknown>");
return label;
}
function NMNetworkMenuItem() { function NMNetworkMenuItem() {
this._init.apply(this, arguments); this._init.apply(this, arguments);
} }
@ -117,10 +124,7 @@ NMNetworkMenuItem.prototype = {
if (!title) { if (!title) {
let ssid = this.bestAP.get_ssid(); let ssid = this.bestAP.get_ssid();
if (ssid) title = ssidToLabel(ssid);
title = NetworkManager.utils_ssid_to_utf8(ssid);
if (!title)
title = _("<unknown>");
} }
this._label = new St.Label({ text: title }); this._label = new St.Label({ text: title });
@ -1002,7 +1006,7 @@ NMDeviceWireless.prototype = {
item: null, item: null,
accessPoints: [ ap ] accessPoints: [ ap ]
}; };
obj.ssidText = NetworkManager.utils_ssid_to_utf8(obj.ssid); obj.ssidText = ssidToLabel(obj.ssid);
this._networks.push(obj); this._networks.push(obj);
} }
@ -1219,7 +1223,7 @@ NMDeviceWireless.prototype = {
item: null, item: null,
accessPoints: [ accessPoint ] accessPoints: [ accessPoint ]
}; };
apObj.ssidText = NetworkManager.utils_ssid_to_utf8(apObj.ssid); apObj.ssidText = ssidToLabel(apObj.ssid);
needsupdate = true; needsupdate = true;
} }