author | benmeyer <benmeyer> | 2002-10-17 15:03:35 (UTC) |
---|---|---|
committer | benmeyer <benmeyer> | 2002-10-17 15:03:35 (UTC) |
commit | 1fa7ebd9512ac0497c3ede198621899a10e961af (patch) (side-by-side diff) | |
tree | 45be4e45b5408f46c3f2e59b1241aebf9a9bf869 /noncore/net/networksetup/interfaces.cpp | |
parent | 6c8ae3c8af454c87f5f467fe17cbdffe4c8f5494 (diff) | |
download | opie-1fa7ebd9512ac0497c3ede198621899a10e961af.zip opie-1fa7ebd9512ac0497c3ede198621899a10e961af.tar.gz opie-1fa7ebd9512ac0497c3ede198621899a10e961af.tar.bz2 |
added interface listing
Diffstat (limited to 'noncore/net/networksetup/interfaces.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/networksetup/interfaces.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/noncore/net/networksetup/interfaces.cpp b/noncore/net/networksetup/interfaces.cpp index b8a3e7f..1287d90 100644 --- a/noncore/net/networksetup/interfaces.cpp +++ b/noncore/net/networksetup/interfaces.cpp @@ -40,10 +40,34 @@ Interfaces::Interfaces(QString useInterfacesFile){ currentMapping = interfaces.end(); } + +/** + * Get a list of all interfaces in the interface file. Usefull for + * hardware that is not currently connected such as an 802.11b card + * not plugged in, but configured for when it is plugged in. + * @return Return string list of interfaces. + **/ +QStringList Interfaces::getInterfaceList(){ + QStringList list; + for ( QStringList::Iterator it = interfaces.begin(); it != interfaces.end(); ++it ) { + QString line = (*it).simplifyWhiteSpace(); + if(line.contains(IFACE)){ + line = line.mid(QString(IFACE).length() +1, line.length()); + line = line.simplifyWhiteSpace(); + int findSpace = line.find(" "); + if( findSpace >= 0){ + line = line.mid(0, findSpace); + list.append(line); + } + } + } + return list; +} + /** * Find out if interface is in an "auto" group or not. * Report any duplicates such as eth0 being in two differnt auto's - * @param + * @param interface interface to check to see if it is on or not. * @return true is interface is in auto */ bool Interfaces::isAuto(QString interface){ |