summaryrefslogtreecommitdiff
path: root/noncore/net/networksetup/interfaces.cpp
Unidiff
Diffstat (limited to 'noncore/net/networksetup/interfaces.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/networksetup/interfaces.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/noncore/net/networksetup/interfaces.cpp b/noncore/net/networksetup/interfaces.cpp
index 1287d90..eef42df 100644
--- a/noncore/net/networksetup/interfaces.cpp
+++ b/noncore/net/networksetup/interfaces.cpp
@@ -346,7 +346,7 @@ bool Interfaces::setMapping(QString interface){
346 * @param interface the name(s) of the interfaces to set to this mapping 346 * @param interface the name(s) of the interfaces to set to this mapping
347 */ 347 */
348void Interfaces::addMapping(QString interfaces){ 348void Interfaces::addMapping(QString option){
349 interfaces.append(""); 349 interfaces.append("");
350 interfaces.append(QString(MAPPING " %1").arg(interfaces)); 350 interfaces.append(QString(MAPPING " %1").arg(option));
351} 351}
352 352
@@ -405,9 +405,10 @@ bool Interfaces::setStanza(QString stanza, QString option, QStringList::Iterator
405 qDebug(QString("Interfaces: Found multiple stanza's for search: %1 %2").arg(stanza).arg(option).latin1()); 405 qDebug(QString("Interfaces: Found multiple stanza's for search: %1 %2").arg(stanza).arg(option).latin1());
406 } 406 }
407 qDebug("Found");
407 found = true; 408 found = true;
408 iterator = it; 409 iterator = it;
409 } 410 }
410 } 411 }
411 return !found; 412 return found;
412} 413}
413 414
@@ -429,7 +430,8 @@ bool Interfaces::setOption(QStringList::Iterator start, QString option, QString
429 interfaces.insert(--it, QString("\t%1 %2").arg(option).arg(value)); 430 interfaces.insert(--it, QString("\t%1 %2").arg(option).arg(value));
430 } 431 }
432 found = true;
431 break; 433 break;
432 } 434 }
433 if((*it).contains(option)){ 435 if((*it).contains(option) && it != start){
434 // Found it in stanza so replace it. 436 // Found it in stanza so replace it.
435 if(found) 437 if(found)
@@ -442,5 +444,10 @@ bool Interfaces::setOption(QStringList::Iterator start, QString option, QString
442 } 444 }
443 } 445 }
444 return true; 446 if(!found){
447 QStringList::Iterator p = start;
448 interfaces.insert(++p, QString("\t%1 %2").arg(option).arg(value));
449 found = true;
450 }
451 return found;
445} 452}
446 453