Diffstat (limited to 'noncore/net/networksetup/interfaces.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/networksetup/interfaces.cpp | 17 |
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 | |||
@@ -347,5 +347,5 @@ bool Interfaces::setMapping(QString interface){ | |||
347 | */ | 347 | */ |
348 | void Interfaces::addMapping(QString interfaces){ | 348 | void 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 | } |
@@ -406,2 +406,3 @@ bool Interfaces::setStanza(QString stanza, QString option, QStringList::Iterator | |||
406 | } | 406 | } |
407 | qDebug("Found"); | ||
407 | found = true; | 408 | found = true; |
@@ -410,3 +411,3 @@ bool Interfaces::setStanza(QString stanza, QString option, QStringList::Iterator | |||
410 | } | 411 | } |
411 | return !found; | 412 | return found; |
412 | } | 413 | } |
@@ -430,5 +431,6 @@ bool Interfaces::setOption(QStringList::Iterator start, QString option, QString | |||
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. |
@@ -443,3 +445,8 @@ bool Interfaces::setOption(QStringList::Iterator start, QString option, QString | |||
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 | } |