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