fix(hotspot):fix error when a wirless device do not support Adhoc(#190431)
This commit is contained in:
parent
45c1d17acb
commit
6d43fd00dd
|
@ -416,7 +416,7 @@ void MobileHotspotWidget::initInterfaceInfo()
|
|||
QMap<QString, bool>::Iterator iter = devMap.begin();
|
||||
while (iter != devMap.end()) {
|
||||
QString interfaceName = iter.key();
|
||||
if (devCapMap[interfaceName] & 0x01) {
|
||||
if (!(devCapMap[interfaceName] & 0x01)) {
|
||||
m_interfaceComboBox->addItem(interfaceName);
|
||||
}
|
||||
iter++;
|
||||
|
|
|
@ -452,11 +452,12 @@ int KyNetworkDeviceResourse::getWirelessDeviceCapability(const QString deviceNam
|
|||
NetworkManager::WirelessDevice *wirelessDevicePtr =
|
||||
qobject_cast<NetworkManager::WirelessDevice *>(connectDevice.data());
|
||||
|
||||
int cap = 0x01;
|
||||
if (!wirelessDevicePtr->wirelessCapabilities() & NetworkManager::WirelessDevice::AdhocCap) {
|
||||
return cap;
|
||||
}
|
||||
int cap = 0x00;
|
||||
if (wirelessDevicePtr->wirelessCapabilities() & NetworkManager::WirelessDevice::AdhocCap) {
|
||||
cap = cap | 0x02;
|
||||
} else {
|
||||
return 0x01;
|
||||
}
|
||||
QDBusInterface dbusInterface("org.freedesktop.NetworkManager",
|
||||
connectDevice->uni(),
|
||||
"org.freedesktop.NetworkManager.Device.Wireless",
|
||||
|
|
Loading…
Reference in New Issue