mirror of
https://github.com/tnodir/fort
synced 2024-11-15 13:37:40 +00:00
UI: ConfManager: Simplify applySavedConf().
This commit is contained in:
parent
64d9be13f8
commit
25fa931443
@ -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) {
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user