diff options
Diffstat (limited to 'src/sysInfo.cpp')
-rw-r--r-- | src/sysInfo.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/sysInfo.cpp b/src/sysInfo.cpp index ca20b95..a261fe5 100644 --- a/src/sysInfo.cpp +++ b/src/sysInfo.cpp @@ -8,14 +8,12 @@ // ------------------------------------------------------------------------------------------------ sysInfo::sysInfo(){ - if (debug) qDebug() << "sysInfo created."; - // Maybe search for eth0, etc } // ------------------------------------------------------------------------------------------------ sysInfo::~sysInfo(){} // ------------------------------------------------------------------------------------------------ QString sysInfo::getInfo(QString& infoName){ - if (debug) qDebug() << "sysInfo : getInfo(" << infoName << ")"; + qxtLog->debug() << "[sysInfo] requested " << infoName; if (infoName == QString("mac")) return getMACAddress(); else if (infoName == QString("ip")) @@ -32,7 +30,7 @@ QString sysInfo::getMACAddress(){ /* Returns MAC address of eth0 for now. */ QNetworkInterface qni = QNetworkInterface::interfaceFromName(QString("eth0")); if (!qni.isValid()){ - if (debug) qDebug() << "No interface matching \"eth0\" found."; + qxtLog->debug() << "No interface matching \"eth0\" found."; return "no_eth0"; } //eth0_index = qni.index(); @@ -47,12 +45,11 @@ QString sysInfo::getIPAddress(){ // This is does not return the right IP atm... foreach(QHostAddress addr, addrlist){ if (addr.protocol() == QAbstractSocket::IPv4Protocol && addr != QHostAddress::LocalHost){ - if (debug) qDebug() << "eth0: IPv4 Address: " << addr.toString(); return addr.toString(); } } // still here? - if (debug) qDebug() << "ip_error"; + qxtLog->debug() << "ip_error"; return "ip_error"; } // ------------------------------------------------------------------------------------------------ @@ -72,7 +69,7 @@ QByteArray sysInfo::getNames(){ QJson::Serializer serializer; QByteArray json = serializer.serialize(jsonV); - if (debug) qDebug() << json; + qxtLog->debug() << json; return json; } @@ -87,7 +84,7 @@ QString sysInfo::getAllInfos(){ //QJson::Serializer serializer; QByteArray json = serializer.serialize(infos); - if (debug) qDebug() << json; + qxtLog->debug() << json; return json; } // ------------------------------------------------------------------------------------------------ |