Skip to content

Commit

Permalink
fix(netconnect):解决蓝牙共享网络不显示的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouxiali authored and Z-bin committed Aug 12, 2021
1 parent a3b910c commit fccdf66
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions plugins/network/netconnect/netconnect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,11 @@ void NetConnect::netDetailSlot(NetDetail *netDetail,QString netName, bool status
}
netDetail->setSSID(netInfo.strConName);
netDetail->setProtocol(netInfo.strConType);
if (netInfo.strConType == "bluetooth") {
netDetail->setBandWidth("- -");
} else {
netDetail->setBandWidth(netInfo.strBandWidth);
}
netDetail->setIPV4(netInfo.strIPV4Address);
netDetail->setIPV4Dns(netInfo.strIPV4Dns);
netDetail->setIPV4Gateway(netInfo.strIPV4GateWay);
Expand All @@ -509,7 +514,6 @@ void NetConnect::netDetailSlot(NetDetail *netDetail,QString netName, bool status
netDetail->setIPV6Prefix(netInfo.strIPV6Prefix);
netDetail->setIPV6Gt(netInfo.strIPV6GateWay);
netDetail->setMac(netInfo.strMac);
netDetail->setBandWidth(netInfo.strBandWidth);
netDetail->setVisible(actLanNames.value(netName));
deviceItem->mAbtBtn->setVisible(true);
preActLan.insert(netName, status);
Expand Down Expand Up @@ -699,7 +703,8 @@ int NetConnect::getWifiListDone(QVector<QStringList> getwifislist, QStringList g
int indexLan = 0;
while (indexLan < mActiveInfo.size()) {
if (mActiveInfo[indexLan].strConType == "ethernet"
|| mActiveInfo[indexLan].strConType == "802-3-ethernet"){
|| mActiveInfo[indexLan].strConType == "802-3-ethernet"
|| mActiveInfo[indexLan].strConType == "bluetooth"){
actLanNames.insert(mActiveInfo[indexLan].strConName, false);
}
indexLan ++;
Expand Down Expand Up @@ -1150,6 +1155,13 @@ int NetConnect::getActiveConInfo(QList<ActiveConInfo>& qlActiveConInfo) {
QDBusConnection::systemBus());
activeNet.strBandWidth = netDeviceifc.property("Speed").toString() + "Mb/s";
activeNet.strMac = netDeviceifc.property("HwAddress").toString().toLower();
} else if (!activeNet.strConType.compare("bluetooth", Qt::CaseInsensitive)){
QDBusInterface netDeviceifc("org.freedesktop.NetworkManager",
replyDevicesPaths.at(0).path(),
"org.freedesktop.NetworkManager.Device.Bluetooth",
QDBusConnection::systemBus());
activeNet.strBandWidth = netDeviceifc.property("Speed").toString() + "Mb/s";
activeNet.strMac = netDeviceifc.property("HwAddress").toString().toLower();
} else {
QDBusInterface netDeviceifc("org.freedesktop.NetworkManager",
replyDevicesPaths.at(0).path(),
Expand Down

0 comments on commit fccdf66

Please sign in to comment.