diff --git a/src/backend/dbus-interface/kylinconnectoperation.cpp b/src/backend/dbus-interface/kylinconnectoperation.cpp index 3c3af528..4701df6b 100644 --- a/src/backend/dbus-interface/kylinconnectoperation.cpp +++ b/src/backend/dbus-interface/kylinconnectoperation.cpp @@ -39,6 +39,7 @@ void KyConnectOperation::ipv4SettingSet( const KyConnectSetting &connectSettingsInfo) { ipv4Setting->setInitialized(true); + ipv4Setting->setDns(connectSettingsInfo.m_ipv4Dns); if (CONFIG_IP_DHCP == connectSettingsInfo.m_ipv4ConfigIpType) { ipv4Setting->setMethod(NetworkManager::Ipv4Setting::Automatic); @@ -46,14 +47,7 @@ void KyConnectOperation::ipv4SettingSet( } else { ipv4Setting->setMethod(NetworkManager::Ipv4Setting::Manual); } - - if (!connectSettingsInfo.m_ipv4Dns.empty()) { - ipv4Setting->setDns(connectSettingsInfo.m_ipv4Dns); - } - - if (!connectSettingsInfo.m_ipv4Address.empty()) { - ipv4Setting->setAddresses(connectSettingsInfo.m_ipv4Address); - } + ipv4Setting->setAddresses(connectSettingsInfo.m_ipv4Address); return; } @@ -62,6 +56,7 @@ void KyConnectOperation::ipv6SettingSet( const KyConnectSetting &connectSettingsInfo) { ipv6Setting->setInitialized(true); + ipv6Setting->setDns(connectSettingsInfo.m_ipv6Dns); if (CONFIG_IP_DHCP == connectSettingsInfo.m_ipv6ConfigIpType) { ipv6Setting->setMethod(NetworkManager::Ipv6Setting::Automatic); @@ -70,15 +65,7 @@ void KyConnectOperation::ipv6SettingSet( } ipv6Setting->setMethod(NetworkManager::Ipv6Setting::Manual); - if (!connectSettingsInfo.m_ipv6Dns.empty()) { - ipv6Setting->setDns(connectSettingsInfo.m_ipv6Dns); - } - - if (!connectSettingsInfo.m_ipv6Address.empty()) { - ipv6Setting->setAddresses(connectSettingsInfo.m_ipv6Address); - } - - + ipv6Setting->setAddresses(connectSettingsInfo.m_ipv6Address); return ; } diff --git a/src/frontend/netdetails/ipv4page.cpp b/src/frontend/netdetails/ipv4page.cpp index 43af26a1..16dcc1a4 100644 --- a/src/frontend/netdetails/ipv4page.cpp +++ b/src/frontend/netdetails/ipv4page.cpp @@ -114,6 +114,13 @@ bool Ipv4Page::checkIsChanged(const ConInfo info, KyConnectSetting &setting) if (info.ipv4ConfigType != CONFIG_IP_DHCP) { qDebug() << "ipv4ConfigType change to Auto"; setting.setIpConfigType(IPADDRESS_V4, CONFIG_IP_DHCP); + QString ipv4address(""); + QString netMask(""); + QString gateWay(""); + QStringList dnsList; + dnsList.empty(); + qDebug() << ipv4address << netMask << gateWay; + setting.ipv4AddressConstruct(ipv4address, netMask, gateWay, dnsList); isChanged = true; } } else { diff --git a/src/frontend/netdetails/ipv6page.cpp b/src/frontend/netdetails/ipv6page.cpp index 4bef6e2f..05ed0593 100644 --- a/src/frontend/netdetails/ipv6page.cpp +++ b/src/frontend/netdetails/ipv6page.cpp @@ -43,6 +43,12 @@ bool Ipv6Page::checkIsChanged(const ConInfo info, KyConnectSetting &setting) if (info.ipv6ConfigType != CONFIG_IP_DHCP) { qDebug() << "ipv6ConfigType change to Auto"; setting.setIpConfigType(IPADDRESS_V6, CONFIG_IP_DHCP); + QString ipv6address(""); + QString prefix(""); + QString gateWay(""); + QStringList dnsList; + dnsList.empty(); + setting.ipv6AddressConstruct(ipv6address, prefix, gateWay, dnsList); isChanged = true; } } else { diff --git a/src/frontend/tab-pages/lanpage.cpp b/src/frontend/tab-pages/lanpage.cpp index 363d4b2e..f46b17a6 100644 --- a/src/frontend/tab-pages/lanpage.cpp +++ b/src/frontend/tab-pages/lanpage.cpp @@ -558,7 +558,7 @@ void LanPage::getWiredList(QMap > &map) m_connectResourse->getConnectionList(deviceName, NetworkManager::ConnectionSettings::Wired, deactivedList); //未激活列表的显示 if (!deactivedList.isEmpty()) { for (int i = 0; i < deactivedList.size(); i++) { - vector.append(QStringList()<m_connectName<m_connectUuid); + vector.append(QStringList()<m_connectName<m_connectUuid << deactivedList.at(i)->m_connectPath); } } map.insert(deviceName, vector);