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.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/noncore/settings/networksettings/interfaces/interfaces.cpp b/noncore/settings/networksettings/interfaces/interfaces.cpp
index 8d3e151..a62a90c 100644
--- a/noncore/settings/networksettings/interfaces/interfaces.cpp
+++ b/noncore/settings/networksettings/interfaces/interfaces.cpp
@@ -22,9 +22,9 @@ Interfaces::Interfaces(QString useInterfacesFile){
22 22
23 interfacesFile = useInterfacesFile; 23 interfacesFile = useInterfacesFile;
24 QFile file(interfacesFile); 24 QFile file(interfacesFile);
25 if (!file.open(IO_ReadOnly)){ 25 if (!file.open(IO_ReadOnly)){
26 qDebug(QString("Interfaces: Can't open file: %1 for reading.").arg(interfacesFile).latin1()); 26 qDebug("Interfaces: Can't open file: %s for reading.", interfacesFile.latin1() );
27 currentIface = interfaces.end(); 27 currentIface = interfaces.end();
28 currentMapping = interfaces.end(); 28 currentMapping = interfaces.end();
29 return; 29 return;
30 } 30 }
@@ -66,20 +66,18 @@ QStringList Interfaces::getInterfaceList(){
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) const { 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 return awi.count() > 0;
80 return false;
81 return true;
82} 80}
83 81
84/** 82/**
85 * Attempt to set the auto option for interface to setAuto. 83 * Attempt to set the auto option for interface to setAuto.