author | benmeyer <benmeyer> | 2002-10-17 16:30:44 (UTC) |
---|---|---|
committer | benmeyer <benmeyer> | 2002-10-17 16:30:44 (UTC) |
commit | 18cc7321db186865629a5c4702074211e42b92fd (patch) (side-by-side diff) | |
tree | beb15112009c1cc966115904a322b32d465e47e6 /noncore/net/networksetup/mainwindowimp.cpp | |
parent | 75f078ec92376db2c90a327bbc50d9bb5c1fb57a (diff) | |
download | opie-18cc7321db186865629a5c4702074211e42b92fd.zip opie-18cc7321db186865629a5c4702074211e42b92fd.tar.gz opie-18cc7321db186865629a5c4702074211e42b92fd.tar.bz2 |
interface is now a qobject
Diffstat (limited to 'noncore/net/networksetup/mainwindowimp.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/networksetup/mainwindowimp.cpp | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/noncore/net/networksetup/mainwindowimp.cpp b/noncore/net/networksetup/mainwindowimp.cpp index b46362f..117bac1 100644 --- a/noncore/net/networksetup/mainwindowimp.cpp +++ b/noncore/net/networksetup/mainwindowimp.cpp @@ -304,21 +304,15 @@ void MainWindowImp::jobDone(KProcess *process){ // We have found an interface
QString interfaceName = line.mid(0, space);
Interface *i;
+ // We have found an interface
+ //qDebug(QString("MainWindowImp: Found Interface: %1").arg(line).latin1());
// See if we already have it
if(interfaceNames.find(interfaceName) == interfaceNames.end()){
if(fileName == TEMP_ALL)
- i = new Interface(interfaceName, false);
+ i = new Interface(this, interfaceName, false);
else
- i = new Interface(interfaceName, true);
- }
- else{
- i = interfaceNames[interfaceName];
- if(fileName != TEMP_ALL)
- i->setStatus(true);
- }
-
+ i = new Interface(this, interfaceName, true);
i->setAttached(true);
- i->setInterfaceName(interfaceName);
QString hardName = "Ethernet";
int hardwareName = line.find("Link encap:");
@@ -327,10 +321,17 @@ void MainWindowImp::jobDone(KProcess *process){ macAddress = line.length();
if(hardwareName != -1)
i->setHardwareName(line.mid(hardwareName+11, macAddress-(hardwareName+11)) + QString(" (%1)").arg(i->getInterfaceName()));
- // We have found an interface
- //qDebug(QString("MainWindowImp: Found Interface: %1").arg(line).latin1());
+
interfaceNames.insert(i->getInterfaceName(), i);
updateInterface(i);
+ connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *)));
+ }
+ // It was an interface we already had.
+ else{
+ i = interfaceNames[interfaceName];
+ if(fileName != TEMP_ALL)
+ i->setStatus(true);
+ }
}
}
file.close();
@@ -347,12 +348,12 @@ void MainWindowImp::jobDone(KProcess *process){ found = true;
}
if(!found){
- Interface *i = new Interface(*ni, false);
+ Interface *i = new Interface(this, *ni, false);
i->setAttached(false);
i->setHardwareName(QString("Disconnected (%1)").arg(*ni));
- i->setInterfaceName(*ni);
interfaceNames.insert(i->getInterfaceName(), i);
updateInterface(i);
+ connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *)));
}
}
}
@@ -395,6 +396,8 @@ void MainWindowImp::updateInterface(Interface *i){ typeName = "irda";
if(i->getInterfaceName().contains("wlan"))
typeName = "wlan";
+ if(i->getInterfaceName().contains("usb"))
+ typeName = "usb";
if(!i->isAttached())
typeName = "connect_no";
|