Merge branch '0904' into 'yhkylin/v101'

fix(hotspot):fix error when a wirless device do not support Adhoc(#190431)

See merge request kylinos-src/kylin-nm!255
This commit is contained in:
赵世旭 2023-09-08 06:17:26 +00:00
commit 53dabb2d8d
2 changed files with 6 additions and 5 deletions

View File

@ -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++;

View File

@ -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;
}
cap = cap | 0x02;
QDBusInterface dbusInterface("org.freedesktop.NetworkManager",
connectDevice->uni(),
"org.freedesktop.NetworkManager.Device.Wireless",