summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/interfaces/interfaces.cpp
Unidiff
Diffstat (limited to 'noncore/settings/networksettings/interfaces/interfaces.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/interfaces/interfaces.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/noncore/settings/networksettings/interfaces/interfaces.cpp b/noncore/settings/networksettings/interfaces/interfaces.cpp
index e49998e..8f685fe 100644
--- a/noncore/settings/networksettings/interfaces/interfaces.cpp
+++ b/noncore/settings/networksettings/interfaces/interfaces.cpp
@@ -62,25 +62,25 @@ QStringList Interfaces::getInterfaceList(){
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 */
74bool Interfaces::isAuto(const QString &interface){ 74bool 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
@@ -130,26 +130,26 @@ bool Interfaces::setAuto(const QString &interface, bool setAuto){
130 * @return bool true if it is successfull. 130 * @return bool true if it is successfull.
131 */ 131 */
132bool Interfaces::setInterface(QString interface){ 132bool 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 */
142bool Interfaces::isInterfaceSet(){ 142bool 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 */
155bool Interfaces::addInterface(const QString &interface, const QString &family, const QString &method){ 155bool Interfaces::addInterface(const QString &interface, const QString &family, const QString &method){