Diffstat (limited to 'noncore/settings/networksettings/interfaces/interfaces.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/interfaces/interfaces.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/noncore/settings/networksettings/interfaces/interfaces.cpp b/noncore/settings/networksettings/interfaces/interfaces.cpp index 6b161ae..e283926 100644 --- a/noncore/settings/networksettings/interfaces/interfaces.cpp +++ b/noncore/settings/networksettings/interfaces/interfaces.cpp | |||
@@ -25,5 +25,5 @@ Interfaces::Interfaces(QString useInterfacesFile){ | |||
25 | QFile file(interfacesFile); | 25 | QFile file(interfacesFile); |
26 | if (!file.open(IO_ReadOnly)){ | 26 | if (!file.open(IO_ReadOnly)){ |
27 | qDebug("Interfaces: Can't open file: %s for reading.", interfacesFile.latin1() ); | 27 | odebug << "Interfaces: Can't open file: " << interfacesFile.latin1() << " for reading." << oendl; |
28 | currentIface = interfaces.end(); | 28 | currentIface = interfaces.end(); |
29 | currentMapping = interfaces.end(); | 29 | currentMapping = interfaces.end(); |
@@ -77,5 +77,5 @@ bool Interfaces::isAuto(const QString &interface) const { | |||
77 | QStringList awi = autoLines.grep(QRegExp(interface)); | 77 | QStringList awi = autoLines.grep(QRegExp(interface)); |
78 | if(awi.count() > 1) | 78 | if(awi.count() > 1) |
79 | qDebug(QString("Interfaces: Found more then auto group with interface: %1.").arg(interface).latin1()); | 79 | odebug << QString("Interfaces: Found more then auto group with interface: %1.").arg(interface).latin1() << oendl; |
80 | return awi.count() > 0; | 80 | return awi.count() > 0; |
81 | } | 81 | } |
@@ -153,5 +153,5 @@ bool Interfaces::isInterfaceSet() const { | |||
153 | */ | 153 | */ |
154 | bool Interfaces::addInterface(const QString &interface, const QString &family, const QString &method){ | 154 | bool Interfaces::addInterface(const QString &interface, const QString &family, const QString &method){ |
155 | qDebug("Interfaces::addInterface(%s)",interface.latin1()); | 155 | odebug << "Interfaces::addInterface(" << interface.latin1() << ")" << oendl; |
156 | if(0 == acceptedFamily.contains(family)) | 156 | if(0 == acceptedFamily.contains(family)) |
157 | return false; | 157 | return false; |
@@ -169,5 +169,5 @@ bool Interfaces::addInterface(const QString &interface, const QString &family, c | |||
169 | */ | 169 | */ |
170 | bool Interfaces::copyInterface(const QString &interface, const QString &newInterface){ | 170 | bool Interfaces::copyInterface(const QString &interface, const QString &newInterface){ |
171 | qDebug("copy interface %s to %s", interface.latin1(), newInterface.latin1()); | 171 | odebug << "copy interface " << interface.latin1() << " to " << newInterface.latin1() << "" << oendl; |
172 | if(!setInterface(interface)) | 172 | if(!setInterface(interface)) |
173 | return false; | 173 | return false; |
@@ -276,5 +276,5 @@ QString Interfaces::getInterfaceMethod(bool &error){ | |||
276 | */ | 276 | */ |
277 | bool Interfaces::setInterfaceName(const QString &newName){ | 277 | bool Interfaces::setInterfaceName(const QString &newName){ |
278 | qDebug("setInterfaceName %s", newName.latin1()); | 278 | odebug << "setInterfaceName " << newName.latin1() << "" << oendl; |
279 | if(currentIface == interfaces.end()) | 279 | if(currentIface == interfaces.end()) |
280 | return false; | 280 | return false; |
@@ -283,5 +283,5 @@ bool Interfaces::setInterfaceName(const QString &newName){ | |||
283 | bool returnValue = false; | 283 | bool returnValue = false; |
284 | QString tmp = QString("iface %1 %2 %3").arg(name).arg(getInterfaceFamily(returnValue)).arg(getInterfaceMethod(returnValue)); | 284 | QString tmp = QString("iface %1 %2 %3").arg(name).arg(getInterfaceFamily(returnValue)).arg(getInterfaceMethod(returnValue)); |
285 | qDebug("setting %s",tmp.latin1()); | 285 | odebug << "setting " << tmp.latin1() << "" << oendl; |
286 | 286 | ||
287 | (*currentIface) = tmp; | 287 | (*currentIface) = tmp; |
@@ -346,5 +346,5 @@ bool Interfaces::setInterfaceOption(const QString &option, const QString &value) | |||
346 | return removeInterfaceOption( option ); | 346 | return removeInterfaceOption( option ); |
347 | 347 | ||
348 | qDebug("iface >%s< option >%s< value >%s<", (*currentIface).latin1(), option.latin1(),value.latin1()); | 348 | odebug << "iface >" << (*currentIface).latin1() << "< option >" << option.latin1() << "< value >" << value.latin1() << "<" << oendl; |
349 | return setOption(currentIface, option, value); | 349 | return setOption(currentIface, option, value); |
350 | } | 350 | } |
@@ -487,5 +487,5 @@ bool Interfaces::setStanza(const QString &stanza, const QString &option, QString | |||
487 | if(valid){ | 487 | if(valid){ |
488 | if(found == true){ | 488 | if(found == true){ |
489 | qDebug(QString("Interfaces: Found multiple stanza's for search: %1 %2").arg(stanza).arg(option).latin1()); | 489 | odebug << QString("Interfaces: Found multiple stanza's for search: %1 %2").arg(stanza).arg(option).latin1() << oendl; |
490 | } | 490 | } |
491 | found = true; | 491 | found = true; |
@@ -506,10 +506,10 @@ bool Interfaces::setOption(const QStringList::Iterator &start, const QString &op | |||
506 | if(start == interfaces.end()) | 506 | if(start == interfaces.end()) |
507 | return false; | 507 | return false; |
508 | qDebug("setting option"); | 508 | odebug << "setting option" << oendl; |
509 | bool found = false; | 509 | bool found = false; |
510 | bool replaced = false; | 510 | bool replaced = false; |
511 | QStringList::Iterator insertAt = NULL; | 511 | QStringList::Iterator insertAt = NULL; |
512 | for ( QStringList::Iterator it = start; it != interfaces.end(); ++it ) { | 512 | for ( QStringList::Iterator it = start; it != interfaces.end(); ++it ) { |
513 | qDebug(" Interfaces::setOption got line >%s<",(*it).latin1()); | 513 | odebug << " Interfaces::setOption got line >" << (*it).latin1() << "<" << oendl; |
514 | // FIXME: was not completly stupid just wrong sice all options got inserted bevore the iface line | 514 | // FIXME: was not completly stupid just wrong sice all options got inserted bevore the iface line |
515 | // but since it works with an empty interfaces file I (tille) will not do anything more | 515 | // but since it works with an empty interfaces file I (tille) will not do anything more |
@@ -519,8 +519,8 @@ bool Interfaces::setOption(const QStringList::Iterator &start, const QString &op | |||
519 | // if(!found && value != ""){ | 519 | // if(!found && value != ""){ |
520 | // // Got to the end of the stanza without finding it, so append it. | 520 | // // Got to the end of the stanza without finding it, so append it. |
521 | // qDebug(" Got to the end of the stanza without finding it, so append it."); | 521 | // odebug << " Got to the end of the stanza without finding it, so append it." << oendl; |
522 | // interfaces.insert(--it, QString("\t%1 %2").arg(option).arg(value)); | 522 | // interfaces.insert(--it, QString("\t%1 %2").arg(option).arg(value)); |
523 | // } | 523 | // } |
524 | qDebug("found 1"); | 524 | odebug << "found 1" << oendl; |
525 | // interfaces.insert(++it, QString("\t%1 %2").arg(option).arg(value)); | 525 | // interfaces.insert(++it, QString("\t%1 %2").arg(option).arg(value)); |
526 | found = true; | 526 | found = true; |
@@ -530,7 +530,7 @@ bool Interfaces::setOption(const QStringList::Iterator &start, const QString &op | |||
530 | if((*it).contains(option) && it != start && (*it).at(0) != '#'){ | 530 | if((*it).contains(option) && it != start && (*it).at(0) != '#'){ |
531 | // Found it in stanza so replace it. | 531 | // Found it in stanza so replace it. |
532 | qDebug("found 2"); | 532 | odebug << "found 2" << oendl; |
533 | if(found) | 533 | if(found) |
534 | qDebug(QString("Interfaces: Set Options found more then one value for option: %1 in stanza: %1").arg(option).arg((*start)).latin1()); | 534 | odebug << QString("Interfaces: Set Options found more then one value for option: %1 in stanza: %1").arg(option).arg((*start)).latin1() << oendl; |
535 | found = true; | 535 | found = true; |
536 | replaced = true; | 536 | replaced = true; |
@@ -539,5 +539,5 @@ bool Interfaces::setOption(const QStringList::Iterator &start, const QString &op | |||
539 | } | 539 | } |
540 | if(!found){ | 540 | if(!found){ |
541 | qDebug("! found insert anyway"); | 541 | odebug << "! found insert anyway" << oendl; |
542 | QStringList::Iterator p = start; | 542 | QStringList::Iterator p = start; |
543 | interfaces.insert(++p, QString("\t%1 %2").arg(option).arg(value)); | 543 | interfaces.insert(++p, QString("\t%1 %2").arg(option).arg(value)); |
@@ -546,5 +546,5 @@ bool Interfaces::setOption(const QStringList::Iterator &start, const QString &op | |||
546 | 546 | ||
547 | if(found && !replaced){ | 547 | if(found && !replaced){ |
548 | qDebug("found iface but not the option so insert it here..."); | 548 | odebug << "found iface but not the option so insert it here..." << oendl; |
549 | interfaces.insert(++insertAt, QString("\t%1 %2").arg(option).arg(value)); | 549 | interfaces.insert(++insertAt, QString("\t%1 %2").arg(option).arg(value)); |
550 | } | 550 | } |
@@ -583,5 +583,5 @@ bool Interfaces::removeOption(const QStringList::Iterator &start, const QString | |||
583 | // Found it in stanza so replace it. | 583 | // Found it in stanza so replace it. |
584 | if(found) | 584 | if(found) |
585 | qDebug(QString("Interfaces: Set Options found more then one value for option: %1 in stanza: %1").arg(option).arg((*start)).latin1()); | 585 | odebug << QString("Interfaces: Set Options found more then one value for option: %1 in stanza: %1").arg(option).arg((*start)).latin1() << oendl; |
586 | found = true; | 586 | found = true; |
587 | it = interfaces.remove( it ); // we really want to remove the line | 587 | it = interfaces.remove( it ); // we really want to remove the line |
@@ -611,5 +611,5 @@ bool Interfaces::removeOption(const QStringList::Iterator &start, const QString | |||
611 | // Found it in stanza so replace it. | 611 | // Found it in stanza so replace it. |
612 | if(found) | 612 | if(found) |
613 | qDebug(QString("Interfaces: Set Options found more then one value for option: %1 in stanza: %1").arg(option).arg((*start)).latin1()); | 613 | odebug << QString("Interfaces: Set Options found more then one value for option: %1 in stanza: %1").arg(option).arg((*start)).latin1() << oendl; |
614 | found = true; | 614 | found = true; |
615 | it = interfaces.remove( it ); // we really want to remove the line | 615 | it = interfaces.remove( it ); // we really want to remove the line |
@@ -664,5 +664,5 @@ QString Interfaces::getOption(const QStringList::Iterator &start, const QString | |||
664 | if((*it).contains(option) && (*it).at(0) != '#'){ | 664 | if((*it).contains(option) && (*it).at(0) != '#'){ |
665 | if(found) | 665 | if(found) |
666 | qDebug(QString("Interfaces: getOption found more then one value: %1 for option: %2 in stanza %3").arg((*it)).arg(option).arg((*start)).latin1()); | 666 | odebug << QString("Interfaces: getOption found more then one value: %1 for option: %2 in stanza %3").arg((*it)).arg(option).arg((*start)).latin1() << oendl; |
667 | found = true; | 667 | found = true; |
668 | QString line = (*it).simplifyWhiteSpace(); | 668 | QString line = (*it).simplifyWhiteSpace(); |
@@ -688,5 +688,5 @@ bool Interfaces::write(){ | |||
688 | 688 | ||
689 | if (!file.open(IO_ReadWrite)){ | 689 | if (!file.open(IO_ReadWrite)){ |
690 | qDebug(QString("Interfaces: Can't open file: %1 for writing.").arg(interfacesFile).latin1()); | 690 | odebug << QString("Interfaces: Can't open file: %1 for writing.").arg(interfacesFile).latin1() << oendl; |
691 | return false; | 691 | return false; |
692 | } | 692 | } |
@@ -701,5 +701,5 @@ bool Interfaces::write(){ | |||
701 | whiteSpaceCount = 0; | 701 | whiteSpaceCount = 0; |
702 | if(whiteSpaceCount < 2){ | 702 | if(whiteSpaceCount < 2){ |
703 | qDebug((*it).latin1()); | 703 | odebug << (*it).latin1() << oendl; |
704 | stream << (*it) << '\n'; | 704 | stream << (*it) << '\n'; |
705 | } | 705 | } |