|
|
|
@ -428,6 +428,7 @@ void ConnectionSettingsEngine::modifyConnectionSettings(QString connUuidStr, QVa
|
|
|
|
|
{
|
|
|
|
|
// Contains adapted code from plasma-nm
|
|
|
|
|
bool wipeClonedMacAddress = false;
|
|
|
|
|
bool wipeIpv4AddressConfig = false;
|
|
|
|
|
bool ensure802_1xSettings = false;
|
|
|
|
|
NetworkManager::Connection::Ptr conn = NetworkManager::findConnectionByUuid(connUuidStr);
|
|
|
|
|
NetworkManager::ConnectionSettings::Ptr connSettings = conn->settings();
|
|
|
|
@ -528,6 +529,8 @@ void ConnectionSettingsEngine::modifyConnectionSettings(QString connUuidStr, QVa
|
|
|
|
|
QList<NetworkManager::IpAddress> ipv4AddrList = settings["ipv4AddressList"].value<QList<NetworkManager::IpAddress>>();
|
|
|
|
|
if (!ipv4AddrList.isEmpty()) {
|
|
|
|
|
connIpv4Setting->setAddresses(ipv4AddrList);
|
|
|
|
|
} else {
|
|
|
|
|
wipeIpv4AddressConfig = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -817,6 +820,16 @@ void ConnectionSettingsEngine::modifyConnectionSettings(QString connUuidStr, QVa
|
|
|
|
|
if (ensure802_1xSettings) {
|
|
|
|
|
connSettingsMap.insert("802-1x", secSetting.toMap());
|
|
|
|
|
}
|
|
|
|
|
if (wipeIpv4AddressConfig) {
|
|
|
|
|
QVariantMap ipv4SettingsMap = connSettingsMap.value("ipv4");
|
|
|
|
|
if (!ipv4SettingsMap.isEmpty()) {
|
|
|
|
|
ipv4SettingsMap.remove("address-data");
|
|
|
|
|
ipv4SettingsMap.remove("addresses");
|
|
|
|
|
ipv4SettingsMap.remove("gateway");
|
|
|
|
|
connSettingsMap.remove("ipv4");
|
|
|
|
|
connSettingsMap.insert("ipv4", ipv4SettingsMap);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (wipeClonedMacAddress) {
|
|
|
|
|
QVariantMap ethSettingsMap = connSettingsMap.value("802-3-ethernet");
|
|
|
|
|
if (!ethSettingsMap.isEmpty()) {
|
|
|
|
|