Fix bug change if of connected wired network do not effect

This commit is contained in:
chenlelin 2021-01-13 19:11:14 +08:00
parent 7d1aeee17b
commit 55db6aecab
3 changed files with 4 additions and 6 deletions

View File

@ -85,7 +85,6 @@ IFace* BackThread::execGetIface()
// if type is wired network
iface->lname = iname;
qDebug() << "有线网的状态是 "<<istateStr;
if (istateStr == "unmanaged") {
iface->lstate = 2; //switch of wired device is off
} else if (istateStr == "disconnected" || istateStr == "unavailable") {

View File

@ -344,9 +344,8 @@ void KylinDBus::getLanIpDNS(QString uuidName, bool isActNet)
dbusArg2nd.beginArray();
while (!dbusArg2nd.atEnd()) {
dbusArg2nd >> strDns;// append map to a vector here if you want to keep it
// 当获取到dns时dns肯定不会为0所以就会有一个类似出栈的操作就会走到atEnd尾部
// 当获取到的dns为空时就没有类似的出栈操作获取到的数字就有问题
if (strDns == 0) {
//dbusArg2nd为空时strDns没有从dbusArg2nd获取到结果
dbusArg2nd.endArray();
}
}

View File

@ -1482,11 +1482,11 @@ void MainWindow::getLanListDone(QStringList slist)
} else {
ccfAct->setLine(false); //最后一个item不显示下划线
}
if (!objKyDBus->dbusLanIpv4.isEmpty()) {
\
if (!objKyDBus->dbusLanIpv4.isEmpty() && !objKyDBus->dbusActiveLanIpv4.isEmpty()) {
if (objKyDBus->dbusActiveLanIpv4 != objKyDBus->dbusLanIpv4) {
//在第三方nm-connection-editor进行新的IP配置后重新连接网络
//objKyDBus->connectWiredNet(nname);
objKyDBus->connectWiredNet(nname);
} else if ((oldActLanName == actLanSsidName.at(kk)) && (oldDbusActLanDNS != objKyDBus->dbusActLanDNS)) {
//在第三方nm-connection-editor进行新的DNS配置后重新连接网络
objKyDBus->connectWiredNet(nname);