判断激活信号需要设备匹配
This commit is contained in:
parent
879835e547
commit
4936fa953e
|
@ -159,9 +159,10 @@ QString KyWirelessNetResource::getDeviceIFace(NetworkManager::ActiveConnection::
|
|||
return sett->interfaceName();
|
||||
}
|
||||
|
||||
void KyWirelessNetResource::getSsidByUuid(const QString uuid, QString &ssid)
|
||||
void KyWirelessNetResource::getSsidByUuid(const QString uuid, QString &ssid, QString &devName)
|
||||
{
|
||||
ssid.clear();
|
||||
devName.clear();
|
||||
NetworkManager::Connection::Ptr connectPtr = m_networkResourceInstance->getConnect(uuid);
|
||||
if (connectPtr.isNull()) {
|
||||
return;
|
||||
|
@ -173,6 +174,7 @@ void KyWirelessNetResource::getSsidByUuid(const QString uuid, QString &ssid)
|
|||
return;
|
||||
}
|
||||
ssid = wireless_sett->ssid();
|
||||
devName = connectPtr->settings()->interfaceName();
|
||||
qDebug() << "getSsidByUuid success " << ssid;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
|
||||
void getWirelessActiveConnection(NetworkManager::ActiveConnection::State state, QMap<QString, QStringList> &map);
|
||||
|
||||
void getSsidByUuid(const QString uuid, QString &ssid);
|
||||
void getSsidByUuid(const QString uuid, QString &ssid, QString &devName);
|
||||
|
||||
|
||||
private:
|
||||
|
|
|
@ -382,13 +382,14 @@ void WlanListItem::onConnectionRemove(QString deviceName, QString ssid)
|
|||
|
||||
void WlanListItem::onWlanStatusChange(QString uuid, NetworkManager::ActiveConnection::State state, NetworkManager::ActiveConnection::Reason reason)
|
||||
{
|
||||
QString ssid;
|
||||
m_resource->getSsidByUuid(uuid,ssid);
|
||||
QString ssid, devName;
|
||||
m_resource->getSsidByUuid(uuid, ssid, devName);
|
||||
if (m_data->m_NetSsid == ssid) {
|
||||
qDebug() << "[WlanPage] State changed to :" << state << Q_FUNC_INFO <<__LINE__;
|
||||
if (state == NetworkManager::ActiveConnection::State::Activating) {
|
||||
if ((state == NetworkManager::ActiveConnection::State::Activating || state == NetworkManager::ActiveConnection::State::Deactivating)
|
||||
&& devName == m_wlanDevice) {
|
||||
m_netButton->startLoading();
|
||||
} else {
|
||||
} else if (){
|
||||
m_netButton->stopLoading();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -430,7 +430,7 @@ void WlanPage::onActivatedWlanChanged(QString uuid, NetworkManager::ActiveConnec
|
|||
qDebug() << "[WlanPage] onActivatedWlanChanged but uuid is invalid";
|
||||
}
|
||||
|
||||
m_resource->getSsidByUuid(uuid, ssid);
|
||||
m_resource->getSsidByUuid(uuid, ssid, devName);
|
||||
|
||||
qDebug() << "emit wlanActiveConnectionStateChanged" << devName << ssid << state;
|
||||
emit wlanActiveConnectionStateChanged(devName, ssid, state);
|
||||
|
@ -463,7 +463,7 @@ void WlanPage::onActivatedWlanChanged(QString uuid, NetworkManager::ActiveConnec
|
|||
}
|
||||
}
|
||||
|
||||
if (state == NetworkManager::ActiveConnection::State::Activated) {
|
||||
if (state == NetworkManager::ActiveConnection::State::Activated && defaultDevice == devName) {
|
||||
//onWlanRemoved(m_wlanDevice, ssid);
|
||||
m_activatedNetListWidget->clear();
|
||||
int height = 0;
|
||||
|
|
Loading…
Reference in New Issue