UI: ConfManager: Simplify applySavedConf().

This commit is contained in:
Nodir Temirkhodjaev 2021-05-10 15:49:09 +03:00
parent 64d9be13f8
commit 25fa931443
2 changed files with 7 additions and 7 deletions

View File

@ -513,14 +513,10 @@ bool ConfManager::saveConf(FirewallConf &conf)
void ConfManager::applySavedConf(FirewallConf *newConf) void ConfManager::applySavedConf(FirewallConf *newConf)
{ {
const bool onlyFlags = !newConf->optEdited(); if (!newConf->anyEdited())
if (onlyFlags && !newConf->anyEdited()) {
if (newConf != conf()) {
newConf->deleteLater(); // RPC leftover
}
return; return;
}
const bool onlyFlags = !newConf->optEdited();
if (conf() != newConf) { if (conf() != newConf) {
if (onlyFlags) { if (onlyFlags) {

View File

@ -63,5 +63,9 @@ bool ConfManagerRpc::saveConf(FirewallConf &newConf)
// Already applied by onConfChanged() & applySavedConf() // Already applied by onConfChanged() & applySavedConf()
newConf.resetEdited(); newConf.resetEdited();
if (&newConf != conf()) {
newConf.deleteLater();
}
return true; return true;
} }