Diffstat (limited to 'noncore/settings/networksettings/interfaces/interfacesetupimp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/interfaces/interfacesetupimp.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp index b40d101..e844d8a 100644 --- a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp +++ b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp @@ -39,16 +39,17 @@ InterfaceSetupImp::~InterfaceSetupImp(){ } /** * Save the current settings, then write out the interfaces file and close. */ bool InterfaceSetupImp::saveChanges(){ bool error; QString iface = interfaces->getInterfaceName(error); + qDebug("InterfaceSetupImp::saveChanges saves interface %s", iface.latin1() ); if(!saveSettings()) return false; interfaces->write(); if (interface->getStatus()) { QString ifup; ifup += "ifdown "; @@ -112,16 +113,19 @@ bool InterfaceSetupImp::saveSettings(){ interfaces->setInterfaceMethod("static"); interfaces->setInterfaceOption("address", ipAddressEdit->text()); interfaces->setInterfaceOption("netmask", subnetMaskEdit->text()); interfaces->setInterfaceOption("gateway", gatewayEdit->text()); if(!firstDNSLineEdit->text().isEmpty() || !secondDNSLineEdit->text().isEmpty()){ QString dns = firstDNSLineEdit->text() + " " + secondDNSLineEdit->text(); interfaces->setInterfaceOption("up "DNSSCRIPT" -a ", dns); interfaces->setInterfaceOption("down "DNSSCRIPT" -r ", dns); + }else{ + interfaces->removeInterfaceOption("up "DNSSCRIPT" -a "); + interfaces->removeInterfaceOption("down "DNSSCRIPT" -r"); } } // IP Information interfaces->setAuto(interface->getInterfaceName(), autoStart->isChecked()); return true; } |