Diffstat (limited to 'noncore/net/networksetup/interfaces/interfaces.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/networksetup/interfaces/interfaces.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/noncore/net/networksetup/interfaces/interfaces.cpp b/noncore/net/networksetup/interfaces/interfaces.cpp index e49998e..8f685fe 100644 --- a/noncore/net/networksetup/interfaces/interfaces.cpp +++ b/noncore/net/networksetup/interfaces/interfaces.cpp | |||
@@ -58,33 +58,33 @@ QStringList Interfaces::getInterfaceList(){ | |||
58 | int findSpace = line.find(" "); | 58 | int findSpace = line.find(" "); |
59 | if( findSpace >= 0){ | 59 | if( findSpace >= 0){ |
60 | line = line.mid(0, findSpace); | 60 | line = line.mid(0, findSpace); |
61 | list.append(line); | 61 | list.append(line); |
62 | } | 62 | } |
63 | } | 63 | } |
64 | } | 64 | } |
65 | return list; | 65 | return list; |
66 | } | 66 | } |
67 | 67 | ||
68 | /** | 68 | /** |
69 | * Find out if interface is in an "auto" group or not. | 69 | * Find out if interface is in an "auto" group or not. |
70 | * Report any duplicates such as eth0 being in two differnt auto's | 70 | * Report any duplicates such as eth0 being in two differnt auto's |
71 | * @param interface interface to check to see if it is on or not. | 71 | * @param interface interface to check to see if it is on or not. |
72 | * @return true is interface is in auto | 72 | * @return true is interface is in auto |
73 | */ | 73 | */ |
74 | bool Interfaces::isAuto(const QString &interface){ | 74 | bool Interfaces::isAuto(const QString &interface) const { |
75 | QStringList autoLines = interfaces.grep(QRegExp(AUTO)); | 75 | QStringList autoLines = interfaces.grep(QRegExp(AUTO)); |
76 | QStringList awi = autoLines.grep(QRegExp(interface)); | 76 | QStringList awi = autoLines.grep(QRegExp(interface)); |
77 | if(awi.count() > 1) | 77 | if(awi.count() > 1) |
78 | qDebug(QString("Interfaces: Found more then auto group with interface: %1.").arg(interface).latin1()); | 78 | qDebug(QString("Interfaces: Found more then auto group with interface: %1.").arg(interface).latin1()); |
79 | if(awi.count() < 1) | 79 | if(awi.count() < 1) |
80 | return false; | 80 | return false; |
81 | return true; | 81 | return true; |
82 | } | 82 | } |
83 | 83 | ||
84 | /** | 84 | /** |
85 | * Attempt to set the auto option for interface to setAuto. | 85 | * Attempt to set the auto option for interface to setAuto. |
86 | * @param interface the interface to set | 86 | * @param interface the interface to set |
87 | * @param setAuto the value to set interface to. | 87 | * @param setAuto the value to set interface to. |
88 | * @return false if already set to setAuto. | 88 | * @return false if already set to setAuto. |
89 | * */ | 89 | * */ |
90 | bool Interfaces::setAuto(const QString &interface, bool setAuto){ | 90 | bool Interfaces::setAuto(const QString &interface, bool setAuto){ |
@@ -126,34 +126,34 @@ bool Interfaces::setAuto(const QString &interface, bool setAuto){ | |||
126 | * Set the current interface to interface. This needs to be done before you | 126 | * Set the current interface to interface. This needs to be done before you |
127 | * can call getFamily(), getMethod, and get/setOption(). | 127 | * can call getFamily(), getMethod, and get/setOption(). |
128 | * @param interface the name of the interface to set. All whitespace is | 128 | * @param interface the name of the interface to set. All whitespace is |
129 | * removed from the interface name. | 129 | * removed from the interface name. |
130 | * @return bool true if it is successfull. | 130 | * @return bool true if it is successfull. |
131 | */ | 131 | */ |
132 | bool Interfaces::setInterface(QString interface){ | 132 | bool Interfaces::setInterface(QString interface){ |
133 | interface = interface.simplifyWhiteSpace(); | 133 | interface = interface.simplifyWhiteSpace(); |
134 | interface = interface.replace(QRegExp(" "), ""); | 134 | interface = interface.replace(QRegExp(" "), ""); |
135 | return setStanza(IFACE, interface, currentIface); | 135 | return setStanza(IFACE, interface, currentIface); |
136 | } | 136 | } |
137 | 137 | ||
138 | /** | 138 | /** |
139 | * A quick helper funtion to see if the current interface is set. | 139 | * A quick helper funtion to see if the current interface is set. |
140 | * @return bool true if set, false otherwise. | 140 | * @return bool true if set, false otherwise. |
141 | */ | 141 | */ |
142 | bool Interfaces::isInterfaceSet(){ | 142 | bool Interfaces::isInterfaceSet() const { |
143 | return (currentIface != interfaces.end()); | 143 | return (interfaces.end() != currentIface); |
144 | } | 144 | } |
145 | 145 | ||
146 | /** | 146 | /** |
147 | * Add a new interface of with the settings - family and method | 147 | * Add a new interface of with the settings - family and method |
148 | * @param interface the name of the interface to set. All whitespace is | 148 | * @param interface the name of the interface to set. All whitespace is |
149 | * removed from the interface name. | 149 | * removed from the interface name. |
150 | * @param family the family of this interface inet or inet, ipx or inet6 | 150 | * @param family the family of this interface inet or inet, ipx or inet6 |
151 | * Must of one of the families defined in interfaces.h | 151 | * Must of one of the families defined in interfaces.h |
152 | * @param method for the family. see interfaces man page for family methods. | 152 | * @param method for the family. see interfaces man page for family methods. |
153 | * @return true if successfull. | 153 | * @return true if successfull. |
154 | */ | 154 | */ |
155 | bool Interfaces::addInterface(const QString &interface, const QString &family, const QString &method){ | 155 | bool Interfaces::addInterface(const QString &interface, const QString &family, const QString &method){ |
156 | if(0 == acceptedFamily.contains(family)) | 156 | if(0 == acceptedFamily.contains(family)) |
157 | return false; | 157 | return false; |
158 | QString newInterface = interface.simplifyWhiteSpace(); | 158 | QString newInterface = interface.simplifyWhiteSpace(); |
159 | newInterface = newInterface.replace(QRegExp(" "), ""); | 159 | newInterface = newInterface.replace(QRegExp(" "), ""); |