Diffstat (limited to 'noncore/settings/networksettings/interfaces.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/interfaces.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/noncore/settings/networksettings/interfaces.cpp b/noncore/settings/networksettings/interfaces.cpp index 9155890..377a6db 100644 --- a/noncore/settings/networksettings/interfaces.cpp +++ b/noncore/settings/networksettings/interfaces.cpp | |||
@@ -50,9 +50,9 @@ Interfaces::Interfaces(QString useInterfacesFile){ | |||
50 | QStringList Interfaces::getInterfaceList(){ | 50 | QStringList Interfaces::getInterfaceList(){ |
51 | QStringList list; | 51 | QStringList list; |
52 | for ( QStringList::Iterator it = interfaces.begin(); it != interfaces.end(); ++it ) { | 52 | for ( QStringList::Iterator it = interfaces.begin(); it != interfaces.end(); ++it ) { |
53 | QString line = (*it).simplifyWhiteSpace(); | 53 | QString line = (*it).simplifyWhiteSpace(); |
54 | if(line.contains(IFACE)){ | 54 | if(line.contains(IFACE) && line.at(0) != '#'){ |
55 | line = line.mid(QString(IFACE).length() +1, line.length()); | 55 | line = line.mid(QString(IFACE).length() +1, line.length()); |
56 | line = line.simplifyWhiteSpace(); | 56 | line = line.simplifyWhiteSpace(); |
57 | int findSpace = line.find(" "); | 57 | int findSpace = line.find(" "); |
58 | if( findSpace >= 0){ | 58 | if( findSpace >= 0){ |
@@ -456,9 +456,9 @@ bool Interfaces::setStanza(QString stanza, QString option, QStringList::Iterator | |||
456 | bool found = false; | 456 | bool found = false; |
457 | iterator = interfaces.end(); | 457 | iterator = interfaces.end(); |
458 | for ( QStringList::Iterator it = interfaces.begin(); it != interfaces.end(); ++it ) { | 458 | for ( QStringList::Iterator it = interfaces.begin(); it != interfaces.end(); ++it ) { |
459 | QString line = (*it).simplifyWhiteSpace(); | 459 | QString line = (*it).simplifyWhiteSpace(); |
460 | if(line.contains(stanza) && line.contains(option)){ | 460 | if(line.contains(stanza) && line.contains(option) && line.at(0) != '#'){ |
461 | uint point = line.find(option); | 461 | uint point = line.find(option); |
462 | bool valid = true; | 462 | bool valid = true; |
463 | if(point > 0){ | 463 | if(point > 0){ |
464 | // There are more chars in the line. check +1 | 464 | // There are more chars in the line. check +1 |
@@ -502,9 +502,9 @@ bool Interfaces::setOption(QStringList::Iterator start, QString option, QString | |||
502 | } | 502 | } |
503 | found = true; | 503 | found = true; |
504 | break; | 504 | break; |
505 | } | 505 | } |
506 | if((*it).contains(option) && it != start){ | 506 | if((*it).contains(option) && it != start && (*it).at(0) != '#'){ |
507 | // Found it in stanza so replace it. | 507 | // Found it in stanza so replace it. |
508 | if(found) | 508 | if(found) |
509 | qDebug(QString("Interfaces: Set Options found more then one value for option: %1 in stanza: %1").arg(option).arg((*start)).latin1()); | 509 | qDebug(QString("Interfaces: Set Options found more then one value for option: %1 in stanza: %1").arg(option).arg((*start)).latin1()); |
510 | found = true; | 510 | found = true; |
@@ -533,9 +533,9 @@ bool Interfaces::removeOption(QStringList::Iterator start, QString option, QStri | |||
533 | if(((*it).contains(IFACE) || (*it).contains(MAPPING) || (*it).contains(AUTO)) && it != start){ | 533 | if(((*it).contains(IFACE) || (*it).contains(MAPPING) || (*it).contains(AUTO)) && it != start){ |
534 | // got to the end without finding it | 534 | // got to the end without finding it |
535 | break; | 535 | break; |
536 | } | 536 | } |
537 | if((*it).contains(option) && (*it).contains(value) &&it != start){ | 537 | if((*it).contains(option) && (*it).contains(value) && it != start && (*it).at(0) != '#'){ |
538 | // Found it in stanza so replace it. | 538 | // Found it in stanza so replace it. |
539 | if(found) | 539 | if(found) |
540 | qDebug(QString("Interfaces: Set Options found more then one value for option: %1 in stanza: %1").arg(option).arg((*start)).latin1()); | 540 | qDebug(QString("Interfaces: Set Options found more then one value for option: %1 in stanza: %1").arg(option).arg((*start)).latin1()); |
541 | found = true; | 541 | found = true; |
@@ -586,9 +586,9 @@ QString Interfaces::getOption(QStringList::Iterator start, QString option, bool | |||
586 | for ( QStringList::Iterator it = start; it != interfaces.end(); ++it ) { | 586 | for ( QStringList::Iterator it = start; it != interfaces.end(); ++it ) { |
587 | if(((*it).contains(IFACE) || (*it).contains(MAPPING) || (*it).contains(AUTO)) && it != start){ | 587 | if(((*it).contains(IFACE) || (*it).contains(MAPPING) || (*it).contains(AUTO)) && it != start){ |
588 | break; | 588 | break; |
589 | } | 589 | } |
590 | if((*it).contains(option)){ | 590 | if((*it).contains(option) && (*it).at(0) != '#'){ |
591 | if(found) | 591 | if(found) |
592 | qDebug(QString("Interfaces: Get Options found more then one value: %1 for option: %2 in stanza %3").arg((*it)).arg(option).arg((*start)).latin1()); | 592 | qDebug(QString("Interfaces: Get Options found more then one value: %1 for option: %2 in stanza %3").arg((*it)).arg(option).arg((*start)).latin1()); |
593 | found = true; | 593 | found = true; |
594 | QString line = (*it).simplifyWhiteSpace(); | 594 | QString line = (*it).simplifyWhiteSpace(); |