This fix aims to get rid of the eth0, eth1...name for network cards.

Signed-off-by: gregory guy <gregory-tde@laposte.net>
pull/6/head
gregory guy 3 years ago
parent d1e8f93d79
commit 59e62bdeba
No known key found for this signature in database
GPG Key ID: 2CC84A1CC6823AF8

@ -281,21 +281,26 @@ void torkView::sendAnonymousEmail() {
bool torkView::checkInterface() { bool torkView::checkInterface() {
bool gotone = false; bool gotone = false;
//Would anyone have this many ethernet cards? TQString sysNet = "/sys/class/net/";
TQStringList devices;
devices << "eth" << "wlan"; TQDir dir(sysNet);
for ( TQStringList::Iterator it = devices.begin(); it != devices.end(); ++it ){ TQStringList netCard = dir.entryList();
for (int i=0; i < 5; i++){
TQString devpath = TQString("/sys/class/net/%1%2").arg((*it)).arg(i); for ( TQStringList::iterator it = netCard.begin(); it != netCard.end(); it++ )
TQDir ethdir(devpath); {
if (ethdir.exists()){ if( (*it) == "." || (*it) == ".." ) continue;
mSysDevPathList.append(devpath);
gotone = true; TQString netDevice = sysNet + (*it) + "/device";
}else TQDir netPath( netDevice );
continue;
if( netPath.exists() )
{
TQString ethCard = sysNet + (*it);
mSysDevPathList.append(ethCard);
gotone = true;
} }
}
}
return gotone; return gotone;
} }

Loading…
Cancel
Save