author | benmeyer <benmeyer> | 2002-10-17 16:30:44 (UTC) |
---|---|---|
committer | benmeyer <benmeyer> | 2002-10-17 16:30:44 (UTC) |
commit | 18cc7321db186865629a5c4702074211e42b92fd (patch) (unidiff) | |
tree | beb15112009c1cc966115904a322b32d465e47e6 /noncore/settings/networksettings/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/settings/networksettings/mainwindowimp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/mainwindowimp.cpp | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/noncore/settings/networksettings/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindowimp.cpp index b46362f..117bac1 100644 --- a/noncore/settings/networksettings/mainwindowimp.cpp +++ b/noncore/settings/networksettings/mainwindowimp.cpp | |||
@@ -306,2 +306,4 @@ void MainWindowImp::jobDone(KProcess *process){ | |||
306 | Interface *i; | 306 | Interface *i; |
307 | // We have found an interface | ||
308 | //qDebug(QString("MainWindowImp: Found Interface: %1").arg(line).latin1()); | ||
307 | // See if we already have it | 309 | // See if we already have it |
@@ -309,6 +311,20 @@ void MainWindowImp::jobDone(KProcess *process){ | |||
309 | if(fileName == TEMP_ALL) | 311 | if(fileName == TEMP_ALL) |
310 | i = new Interface(interfaceName, false); | 312 | i = new Interface(this, interfaceName, false); |
311 | else | 313 | else |
312 | i = new Interface(interfaceName, true); | 314 | i = new Interface(this, interfaceName, true); |
315 | i->setAttached(true); | ||
316 | |||
317 | QString hardName = "Ethernet"; | ||
318 | int hardwareName = line.find("Link encap:"); | ||
319 | int macAddress = line.find("HWaddr"); | ||
320 | if(macAddress == -1) | ||
321 | macAddress = line.length(); | ||
322 | if(hardwareName != -1) | ||
323 | i->setHardwareName(line.mid(hardwareName+11, macAddress-(hardwareName+11)) + QString(" (%1)").arg(i->getInterfaceName())); | ||
324 | |||
325 | interfaceNames.insert(i->getInterfaceName(), i); | ||
326 | updateInterface(i); | ||
327 | connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *))); | ||
313 | } | 328 | } |
329 | // It was an interface we already had. | ||
314 | else{ | 330 | else{ |
@@ -318,17 +334,2 @@ void MainWindowImp::jobDone(KProcess *process){ | |||
318 | } | 334 | } |
319 | |||
320 | i->setAttached(true); | ||
321 | i->setInterfaceName(interfaceName); | ||
322 | |||
323 | QString hardName = "Ethernet"; | ||
324 | int hardwareName = line.find("Link encap:"); | ||
325 | int macAddress = line.find("HWaddr"); | ||
326 | if(macAddress == -1) | ||
327 | macAddress = line.length(); | ||
328 | if(hardwareName != -1) | ||
329 | i->setHardwareName(line.mid(hardwareName+11, macAddress-(hardwareName+11)) + QString(" (%1)").arg(i->getInterfaceName())); | ||
330 | // We have found an interface | ||
331 | //qDebug(QString("MainWindowImp: Found Interface: %1").arg(line).latin1()); | ||
332 | interfaceNames.insert(i->getInterfaceName(), i); | ||
333 | updateInterface(i); | ||
334 | } | 335 | } |
@@ -349,8 +350,8 @@ void MainWindowImp::jobDone(KProcess *process){ | |||
349 | if(!found){ | 350 | if(!found){ |
350 | Interface *i = new Interface(*ni, false); | 351 | Interface *i = new Interface(this, *ni, false); |
351 | i->setAttached(false); | 352 | i->setAttached(false); |
352 | i->setHardwareName(QString("Disconnected (%1)").arg(*ni)); | 353 | i->setHardwareName(QString("Disconnected (%1)").arg(*ni)); |
353 | i->setInterfaceName(*ni); | ||
354 | interfaceNames.insert(i->getInterfaceName(), i); | 354 | interfaceNames.insert(i->getInterfaceName(), i); |
355 | updateInterface(i); | 355 | updateInterface(i); |
356 | connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *))); | ||
356 | } | 357 | } |
@@ -397,3 +398,5 @@ void MainWindowImp::updateInterface(Interface *i){ | |||
397 | typeName = "wlan"; | 398 | typeName = "wlan"; |
398 | 399 | if(i->getInterfaceName().contains("usb")) | |
400 | typeName = "usb"; | ||
401 | |||
399 | if(!i->isAttached()) | 402 | if(!i->isAttached()) |