NetworkMenu: fixup device descriptions
Fix some bugs in Util.fixupPCIDescription(), that caused all device descriptions to be empty. https://bugzilla.gnome.org/show_bug.cgi?id=646074
This commit is contained in:
parent
ef552846d1
commit
b2b685e46d
@ -150,7 +150,7 @@ const _IGNORED_WORDS = [
|
|||||||
'Incorporated',
|
'Incorporated',
|
||||||
'Ltd.',
|
'Ltd.',
|
||||||
'Limited.',
|
'Limited.',
|
||||||
'Intel?',
|
'Intel',
|
||||||
'chipset',
|
'chipset',
|
||||||
'adapter',
|
'adapter',
|
||||||
'[hex]',
|
'[hex]',
|
||||||
@ -181,7 +181,7 @@ const _IGNORED_PHRASES = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
function fixupPCIDescription(desc) {
|
function fixupPCIDescription(desc) {
|
||||||
desc.replace(/[_,]/, ' ');
|
desc = desc.replace(/[_,]/, ' ');
|
||||||
|
|
||||||
/* Attempt to shorten ID by ignoring certain phrases */
|
/* Attempt to shorten ID by ignoring certain phrases */
|
||||||
for (let i = 0; i < _IGNORED_PHRASES.length; i++) {
|
for (let i = 0; i < _IGNORED_PHRASES.length; i++) {
|
||||||
@ -197,7 +197,7 @@ function fixupPCIDescription(desc) {
|
|||||||
/* Attmept to shorten ID by ignoring certain individual words */
|
/* Attmept to shorten ID by ignoring certain individual words */
|
||||||
let words = desc.split(' ');
|
let words = desc.split(' ');
|
||||||
let out = [ ];
|
let out = [ ];
|
||||||
for (let i = 0; i < words; i++) {
|
for (let i = 0; i < words.length; i++) {
|
||||||
let item = words[i];
|
let item = words[i];
|
||||||
|
|
||||||
// skip empty items (that come out from consecutive spaces)
|
// skip empty items (that come out from consecutive spaces)
|
||||||
|
Loading…
Reference in New Issue
Block a user