From 3e76f5ca4439ae87f436080b840dba180fb842d3 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Sun, 20 Mar 2011 19:37:58 +0100 Subject: debug console now powered by qxt, custom engines, updated debug msgs. Download manager now uses notify(message) to send error/status to the javascript interface, checks for download errors (still some missing) --- src/sysInfo.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/sysInfo.cpp') 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; } // ------------------------------------------------------------------------------------------------ -- cgit v1.2.3-55-g7522