summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/interfaces.cpp
authorbenmeyer <benmeyer>2002-10-18 14:28:42 (UTC)
committer benmeyer <benmeyer>2002-10-18 14:28:42 (UTC)
commit88b3a159060ed7057bfee4cc1ccfcf81a63a4780 (patch) (side-by-side diff)
tree3dd78d403f337c73bb3ca9d75ef0a29f2adae9b6 /noncore/settings/networksettings/interfaces.cpp
parent461113126af82cd6343eedab36ecabb4253780ee (diff)
downloadopie-88b3a159060ed7057bfee4cc1ccfcf81a63a4780.zip
opie-88b3a159060ed7057bfee4cc1ccfcf81a63a4780.tar.gz
opie-88b3a159060ed7057bfee4cc1ccfcf81a63a4780.tar.bz2
More profile stuff works
Diffstat (limited to 'noncore/settings/networksettings/interfaces.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/interfaces.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/noncore/settings/networksettings/interfaces.cpp b/noncore/settings/networksettings/interfaces.cpp
index 1287d90..eef42df 100644
--- a/noncore/settings/networksettings/interfaces.cpp
+++ b/noncore/settings/networksettings/interfaces.cpp
@@ -345,9 +345,9 @@ 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));
}
/**
@@ -404,11 +404,12 @@ bool Interfaces::setStanza(QString stanza, QString option, QStringList::Iterator
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;
}
/**
@@ -428,9 +429,10 @@ bool Interfaces::setOption(QStringList::Iterator start, QString option, QString
// 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());
@@ -441,7 +443,12 @@ bool Interfaces::setOption(QStringList::Iterator start, QString option, QString
(*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;
}
/**