diff options
author | Niklas | 2011-10-24 16:50:43 +0200 |
---|---|---|
committer | Niklas | 2011-10-24 16:50:43 +0200 |
commit | c5d6318bd5fe4cfa66e5a4c4fd8676a6917f29dc (patch) | |
tree | eb021f9c4f154d1e03c0ecf9072e14762d506d25 /src/networkdiscovery.cpp | |
parent | manual conf. onchange interface, present the already collected infos (diff) | |
download | fbgui-c5d6318bd5fe4cfa66e5a4c4fd8676a6917f29dc.tar.gz fbgui-c5d6318bd5fe4cfa66e5a4c4fd8676a6917f29dc.tar.xz fbgui-c5d6318bd5fe4cfa66e5a4c4fd8676a6917f29dc.zip |
no working
Diffstat (limited to 'src/networkdiscovery.cpp')
-rw-r--r-- | src/networkdiscovery.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/networkdiscovery.cpp b/src/networkdiscovery.cpp index df1ae3c..75e822b 100644 --- a/src/networkdiscovery.cpp +++ b/src/networkdiscovery.cpp @@ -257,6 +257,7 @@ QString NetworkDiscovery::readLogFile() { return retval; } } + qxtLog->debug() << _tag << " could not open log file"; } @@ -271,11 +272,11 @@ QString NetworkDiscovery::readLogFile() { */ void NetworkDiscovery::tryAgain() { // kill all cdhcpcd processes - qDebug() << " kill cdhcpcd processes"; + qxtLog->debug() << " kill cdhcpcd processes"; QProcess * p = new QProcess(this); p->start("killall cdhcpcd"); p->waitForFinished(); - qDebug() << _tag << "[tryAgain]" << p->errorString(); + qxtLog->debug() << _tag << "[tryAgain]" << p->errorString(); /* foreach(Q_PID pid , _pidsList) { if (kill(pid,SIGKILL) <= -1) @@ -302,11 +303,21 @@ void NetworkDiscovery::tryAgain() { } + /**/ QVariantMap NetworkDiscovery::getInterfaceConfig(QString ifName) { + QVariantMap jsonObj; QList<QString> dns; interfaceconfiguration * ifc = _ifcMap.value(ifName, NULL); if (ifc != NULL) { + jsonObj.insert("ipaddr",ifc->getIpAddress()); + jsonObj.insert("netmask",ifc->getNetmask()); + jsonObj.insert("broadcast",ifc->getBroadcast()); + jsonObj.insert("gateway",ifc->getGateway()); + + dns.clear(); + dns = ifc->getDnsservers().trimmed().split(" "); + jsonObj.insert("dns",dns.first()); // // dns.clear(); // dns = ifc->getDnsservers().trimmed().split(" "); @@ -315,6 +326,7 @@ QVariantMap NetworkDiscovery::getInterfaceConfig(QString ifName) { // //ifc->getGateway(), 0, AF_INET, "/etc/", dns); // } + return jsonObj; } |