From 41df272c7e231509cb5a33678934d9261a2a7c5d Mon Sep 17 00:00:00 2001 From: ksn Date: Fri, 24 Sep 2021 13:44:01 +0800 Subject: [PATCH] modify --- src/frontend/tab-pages/lanpage.cpp | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/frontend/tab-pages/lanpage.cpp b/src/frontend/tab-pages/lanpage.cpp index e00fac38..8d291b33 100644 --- a/src/frontend/tab-pages/lanpage.cpp +++ b/src/frontend/tab-pages/lanpage.cpp @@ -459,21 +459,8 @@ void LanPage::updateLanlist(QString uuid, NetworkManager::ActiveConnection::Stat //lanpage函数内持续监听连接状态的变化并记录供其他函数调用获取状态 QString devName; NetworkManager::ConnectionSettings::ConnectionType type; - if (m_connectResourse->getInterfaceByUuid(devName, type, uuid)) { - if (type != NetworkManager::ConnectionSettings::ConnectionType::Wired) { - return; - } - } - if (NetworkManager::ActiveConnection::State::Activated == state){ - m_isLanConnected = true; - qDebug() << "[lanpage]lanIsConnected status : " << m_isLanConnected << Q_FUNC_INFO << __LINE__ ; - } else { - m_isLanConnected = false; - qDebug() << "=[lanpage]lanIsConnected status : " << m_isLanConnected << Q_FUNC_INFO << __LINE__ ; - } + qDebug()<<"[LanPage] State change slot:"<getInterfaceByUuid(devName, type, uuid)) { if (type != NetworkManager::ConnectionSettings::ConnectionType::Wired) { @@ -502,6 +489,7 @@ void LanPage::updateLanlist(QString uuid, NetworkManager::ActiveConnection::Stat qDebug() << "[LanPage] Update Device Name:" << m_deviceName; + m_isLanConnected = false; if (state == NetworkManager::ActiveConnection::State::Deactivated) { qDebug()<<"Get a deactivate, begin to remove it from activeList"; QMap::iterator i; @@ -540,6 +528,7 @@ void LanPage::updateLanlist(QString uuid, NetworkManager::ActiveConnection::Stat } } } else if (state == NetworkManager::ActiveConnection::State::Activated) { + m_isLanConnected = true; qDebug()<<"Get an actived connection, begin to move it from deactive to avtive!"; QMap::iterator iter; //在未激活列表里删除 for (iter = m_deactiveMap.begin(); iter != m_deactiveMap.constEnd(); ++iter) {