This commit is contained in:
jzxc95 2021-09-17 10:47:54 +08:00
parent 184366de8f
commit f6bdf25c7f
4 changed files with 18 additions and 18 deletions

View File

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

View File

@ -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 {

View File

@ -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 {

View File

@ -558,7 +558,7 @@ void LanPage::getWiredList(QMap<QString, QVector<QStringList> > &map)
m_connectResourse->getConnectionList(deviceName, NetworkManager::ConnectionSettings::Wired, deactivedList); //未激活列表的显示
if (!deactivedList.isEmpty()) {
for (int i = 0; i < deactivedList.size(); i++) {
vector.append(QStringList()<<deactivedList.at(i)->m_connectName<<deactivedList.at(i)->m_connectUuid);
vector.append(QStringList()<<deactivedList.at(i)->m_connectName<<deactivedList.at(i)->m_connectUuid << deactivedList.at(i)->m_connectPath);
}
}
map.insert(deviceName, vector);