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 | |||
@@ -41,8 +41,32 @@ Interfaces::Interfaces(QString useInterfacesFile){ | |||
41 | } | 41 | } |
42 | 42 | ||
43 | |||
44 | /** | ||
45 | * Get a list of all interfaces in the interface file. Usefull for | ||
46 | * hardware that is not currently connected such as an 802.11b card | ||
47 | * not plugged in, but configured for when it is plugged in. | ||
48 | * @return Return string list of interfaces. | ||
49 | **/ | ||
50 | QStringList Interfaces::getInterfaceList(){ | ||
51 | QStringList list; | ||
52 | for ( QStringList::Iterator it = interfaces.begin(); it != interfaces.end(); ++it ) { | ||
53 | QString line = (*it).simplifyWhiteSpace(); | ||
54 | if(line.contains(IFACE)){ | ||
55 | line = line.mid(QString(IFACE).length() +1, line.length()); | ||
56 | line = line.simplifyWhiteSpace(); | ||
57 | int findSpace = line.find(" "); | ||
58 | if( findSpace >= 0){ | ||
59 | line = line.mid(0, findSpace); | ||
60 | list.append(line); | ||
61 | } | ||
62 | } | ||
63 | } | ||
64 | return list; | ||
65 | } | ||
66 | |||
43 | /** | 67 | /** |
44 | * Find out if interface is in an "auto" group or not. | 68 | * Find out if interface is in an "auto" group or not. |
45 | * Report any duplicates such as eth0 being in two differnt auto's | 69 | * Report any duplicates such as eth0 being in two differnt auto's |
46 | * @param | 70 | * @param interface interface to check to see if it is on or not. |
47 | * @return true is interface is in auto | 71 | * @return true is interface is in auto |
48 | */ | 72 | */ |