author | benmeyer <benmeyer> | 2002-10-18 14:28:42 (UTC) |
---|---|---|
committer | benmeyer <benmeyer> | 2002-10-18 14:28:42 (UTC) |
commit | 88b3a159060ed7057bfee4cc1ccfcf81a63a4780 (patch) (side-by-side diff) | |
tree | 3dd78d403f337c73bb3ca9d75ef0a29f2adae9b6 /noncore/net/networksetup/interfaces.cpp | |
parent | 461113126af82cd6343eedab36ecabb4253780ee (diff) | |
download | opie-88b3a159060ed7057bfee4cc1ccfcf81a63a4780.zip opie-88b3a159060ed7057bfee4cc1ccfcf81a63a4780.tar.gz opie-88b3a159060ed7057bfee4cc1ccfcf81a63a4780.tar.bz2 |
More profile stuff works
Diffstat (limited to 'noncore/net/networksetup/interfaces.cpp') (more/less context) (ignore 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 @@ -344,11 +344,11 @@ bool Interfaces::setMapping(QString interface){ /** * Adds a new Mapping to the interfaces file with interfaces. * @param interface the name(s) of the interfaces to set to this mapping */ -void Interfaces::addMapping(QString interfaces){ +void Interfaces::addMapping(QString option){ interfaces.append(""); - interfaces.append(QString(MAPPING " %1").arg(interfaces)); + interfaces.append(QString(MAPPING " %1").arg(option)); } /** * Set a map option within a mapping. @@ -403,13 +403,14 @@ bool Interfaces::setStanza(QString stanza, QString option, QStringList::Iterator if(line.contains(stanza) && line.contains(option)){ if(found == true){ qDebug(QString("Interfaces: Found multiple stanza's for search: %1 %2").arg(stanza).arg(option).latin1()); } + qDebug("Found"); found = true; iterator = it; } } - return !found; + return found; } /** * Sets a value of an option in a stanza @@ -427,11 +428,12 @@ bool Interfaces::setOption(QStringList::Iterator start, QString option, QString if(!found && value != ""){ // Got to the end of the stanza without finding it, so append it. interfaces.insert(--it, QString("\t%1 %2").arg(option).arg(value)); } + found = true; break; } - if((*it).contains(option)){ + if((*it).contains(option) && it != start){ // Found it in stanza so replace it. if(found) qDebug(QString("Interfaces: Set Options found more then one value for option: %1 in stanza: %1").arg(option).arg((*start)).latin1()); found = true; @@ -440,9 +442,14 @@ bool Interfaces::setOption(QStringList::Iterator start, QString option, QString else (*it) = QString("\t%1 %2").arg(option).arg(value); } } - return true; + if(!found){ + QStringList::Iterator p = start; + interfaces.insert(++p, QString("\t%1 %2").arg(option).arg(value)); + found = true; + } + return found; } /** * Removes all options in a stanza |