fix: query active info when hotspot enabled

Change-Id: Iaa4ed417d7b3b6dcbea0ca79c95e621164adcec3
This commit is contained in:
listenerri 2018-10-12 11:11:02 +08:00
parent b30144cb25
commit 4b557ae9a2

View File

@ -50,7 +50,9 @@ WirelessItem::WirelessItem(WirelessDevice *device)
connect(static_cast<WirelessDevice *>(m_device), &WirelessDevice::activeApInfoChanged, m_refershTimer, static_cast<void (QTimer::*) ()>(&QTimer::start));
connect(static_cast<WirelessDevice *>(m_device), &WirelessDevice::activeConnectionChanged, m_refershTimer, static_cast<void (QTimer::*) ()>(&QTimer::start));
connect(m_refershTimer, &QTimer::timeout, [=] {
if (m_device->status() == NetworkDevice::Activated && static_cast<WirelessDevice *>(m_device)->activeApInfo().isEmpty()) {
WirelessDevice *dev = static_cast<WirelessDevice *>(m_device);
// the status is Activated and activeApInfo is empty if the hotspot status of this wireless device is enabled
if (m_device->status() == NetworkDevice::Activated && dev->activeApInfo().isEmpty() && !dev->hotspotEnabled()) {
Q_EMIT queryActiveConnInfo();
return;
}