From 3abefc6eab4294f065945dd6e2fdfcd21d8c058c Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Fri, 2 Feb 2018 12:49:04 -0500 Subject: Another couple tweaks to the networking notification systems. --- src-qt5/src-cpp/framework-OSInterface-FreeBSD.cpp | 2 +- src-qt5/src-cpp/framework-OSInterface_private.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src-qt5/src-cpp/framework-OSInterface-FreeBSD.cpp b/src-qt5/src-cpp/framework-OSInterface-FreeBSD.cpp index a1bdbdca..247b1bdb 100644 --- a/src-qt5/src-cpp/framework-OSInterface-FreeBSD.cpp +++ b/src-qt5/src-cpp/framework-OSInterface-FreeBSD.cpp @@ -106,7 +106,7 @@ float OSInterface::OS_networkStrengthFromDeviceName(QString name){ // Step 2: Scan access point to get signal/noise info = getCmdOutput("ifconfig", QStringList() << name << "list" << "scan").filter(bssid); if(info.isEmpty()){ return -1; } - QString signoise =info.first().section(" ", 4,4).simplified(); + QString signoise =info.first().section(" ", 4,4, QString::SectionSkipEmpty).simplified(); int sig = signoise.section(":",0,0).toInt(); int noise = signoise.section(":",1,1).toInt(); // Step 3: Turn signal/noise ratio into a percentage diff --git a/src-qt5/src-cpp/framework-OSInterface_private.cpp b/src-qt5/src-cpp/framework-OSInterface_private.cpp index 99b3125f..6275b3f1 100644 --- a/src-qt5/src-cpp/framework-OSInterface_private.cpp +++ b/src-qt5/src-cpp/framework-OSInterface_private.cpp @@ -87,7 +87,7 @@ void OSInterface::connectIodevice(){ void OSInterface::connectNetman(){ if(netman==0){ return; } - connect(netman, SIGNAL(networkAccessibleChanged(QNetworkAccessManager::NetworkAccessibility)), this, SLOT(netAccessChanged()) ); + connect(netman, SIGNAL(networkAccessibleChanged(QNetworkAccessManager::NetworkAccessibility)), this, SLOT(NetworkTimerUpdate()) ); connect(netman, SIGNAL(finished(QNetworkReply*)), this, SLOT(netRequestFinished(QNetworkReply*)) ); connect(netman, SIGNAL(sslErrors(QNetworkReply*, const QList&)), this, SLOT(netSslErrors(QNetworkReply*, const QList&)) ); } @@ -307,7 +307,8 @@ void OSInterface::syncNetworkInfo(OSInterface *os, QHash *has if( addressList[j].ip().isLoopback() ){ continue; } addressList[j].ip().toIPv4Address(&ok); } - if(ok){ active = netconfigL[i]; break; } + if(ok){ active = netconfigL[i]; break; } //found a good one with a valid IPv4 + else if(active. } if(!active.isValid()){ active = netman->activeConfiguration(); } //use the default Qt-detected interface //Type of connection @@ -367,7 +368,7 @@ void OSInterface::syncNetworkInfo(OSInterface *os, QHash *has hash->insert("netaccess/icon",icon); //qDebug() << "[DEBUG] Emit NetworkStatusChanged"; os->emit networkStatusChanged(); - timer->start(); + QTimer::singleShot(0, timer, SLOT(start())); } -- cgit