add notification module

fix definition of network deivce
This commit is contained in:
arcan1s
2014-09-02 04:30:43 +04:00
parent a5c352bc06
commit b61d514cb2
9 changed files with 86 additions and 53 deletions

View File

@ -99,7 +99,7 @@ QString AwesomeWidget::getNetworkDevice()
QList<QNetworkInterface> rawInterfaceList = QNetworkInterface::allInterfaces();
for (int i=0; i<rawInterfaceList.count(); i++)
if ((rawInterfaceList[i].flags().testFlag(QNetworkInterface::IsUp)) &&
(rawInterfaceList[i].flags().testFlag(QNetworkInterface::IsLoopBack)))
(!rawInterfaceList[i].flags().testFlag(QNetworkInterface::IsLoopBack)))
device = rawInterfaceList[i].name();
}
@ -117,7 +117,7 @@ int AwesomeWidget::getNumberCpus()
if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode;
if (process.exitCode != 0)
if (debug) qDebug() << PDEBUG << ":" << "Error" << process.error;
return QTextCodec::codecForMib(106)->toUnicode(process.output).toInt();
return QTextCodec::codecForMib(106)->toUnicode(process.output).trimmed().toInt();
}