Fix bug wifi list show anbormal if change connect name of wifi

This commit is contained in:
chenlelin 2021-02-24 10:13:37 +08:00
parent 25e5185b30
commit 99daef74a9
2 changed files with 11 additions and 2 deletions

View File

@ -1048,7 +1048,6 @@ QList<QString> KylinDBus::getAtiveWifiBSsidUuid()
QDBusConnection::systemBus() );
//先获取uuid
qDebug() << "00000000000000000000";
QDBusReply<QVariant> replyUuid = interfaceInfo.call("Get", "org.freedesktop.NetworkManager.Connection.Active", "Uuid");
//qDebug() << "wifi uuid : "<< replyUuid.value().toString();
strBSsidUuid.append(replyUuid.value().toString());

View File

@ -1797,6 +1797,16 @@ void MainWindow::loadWifiListDone(QStringList slist)
QStringList wnames;
int count = 0;
for (int i = 1; i < slist.size(); i ++) {
QString line = slist.at(i);
QString wbssid = line.mid(indexBSsid, 17).trimmed();
QString wname = line.mid(indexName).trimmed();
if (actWifiBssidList.contains(wbssid)) {
actWifiName = wname;
}
}
for (int i = 1, j = 0; i < slist.size(); i ++) {
QString line = slist.at(i);
QString wsignal = line.mid(0, indexSecu).trimmed();
@ -1835,7 +1845,7 @@ void MainWindow::loadWifiListDone(QStringList slist)
}
if (wname != "" && wname != "--") {
//qDebug() << "wifi的 bssid: " << wbssid << "当前连接的wifi的bssid: " << actWifiBssidList;
qDebug() << "wifi的 bssid: " << wbssid << "当前连接的wifi的bssid: " << actWifiBssidList;
if (actWifiBssidList.contains(wbssid) && wifiActState == 2) {
//对于已经连接的wifi
connect(ccf, SIGNAL(selectedOneWifiForm(QString,int)), this, SLOT(oneTopWifiFormSelected(QString,int)));