Diffstat (limited to 'noncore/settings/networksettings/interfaces.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/interfaces.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/noncore/settings/networksettings/interfaces.cpp b/noncore/settings/networksettings/interfaces.cpp index b8a3e7f..1287d90 100644 --- a/noncore/settings/networksettings/interfaces.cpp +++ b/noncore/settings/networksettings/interfaces.cpp | |||
@@ -40,10 +40,34 @@ Interfaces::Interfaces(QString useInterfacesFile){ | |||
40 | currentMapping = interfaces.end(); | 40 | currentMapping = interfaces.end(); |
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 | */ |
49 | bool Interfaces::isAuto(QString interface){ | 73 | bool Interfaces::isAuto(QString interface){ |