From 9270203de4f4bac37324f43fee508794fd2e8bbb Mon Sep 17 00:00:00 2001 From: Nodir Temirkhodjaev Date: Sat, 23 Dec 2023 13:31:40 +0300 Subject: [PATCH] UI: FirewallConf::*Variant: Rename param name --- src/ui/conf/confmanager.cpp | 4 ++-- src/ui/conf/firewallconf.cpp | 10 +++++----- src/ui/conf/firewallconf.h | 4 ++-- src/ui/rpc/confmanagerrpc.cpp | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/ui/conf/confmanager.cpp b/src/ui/conf/confmanager.cpp index 2cff67db..11b64423 100644 --- a/src/ui/conf/confmanager.cpp +++ b/src/ui/conf/confmanager.cpp @@ -804,7 +804,7 @@ void ConfManager::saveIniUser(bool edited, bool onlyFlags) QVariant ConfManager::toPatchVariant(bool onlyFlags) const { - return onlyFlags ? conf()->toVariant(true) // send only flags to clients + return onlyFlags ? conf()->toVariant(/*onlyEdited=*/true) // send only flags to clients : FirewallConf::editedFlagsToVariant( FirewallConf::AllEdited); // clients have to reload all from storage } @@ -824,7 +824,7 @@ bool ConfManager::saveVariant(const QVariant &confVar) conf = this->conf(); } - conf->fromVariant(confVar, true); + conf->fromVariant(confVar, /*onlyEdited=*/true); if (!saveConf(*conf)) { if (isNewConf) { diff --git a/src/ui/conf/firewallconf.cpp b/src/ui/conf/firewallconf.cpp index bfb0fdea..1f0f4c27 100644 --- a/src/ui/conf/firewallconf.cpp +++ b/src/ui/conf/firewallconf.cpp @@ -465,13 +465,13 @@ void FirewallConf::removedAppGroupIdListFromVariant(const QVariant &v) } } -QVariant FirewallConf::toVariant(bool onlyFlags) const +QVariant FirewallConf::toVariant(bool onlyEdited) const { QVariantMap map; - const EditedFlags flags = onlyFlags ? editedFlags() : AllEdited; + const EditedFlags flags = onlyEdited ? editedFlags() : AllEdited; - if (onlyFlags) { + if (onlyEdited) { map = editedFlagsToVariant(flags).toMap(); } @@ -496,11 +496,11 @@ QVariant FirewallConf::toVariant(bool onlyFlags) const return map; } -void FirewallConf::fromVariant(const QVariant &v, bool onlyFlags) +void FirewallConf::fromVariant(const QVariant &v, bool onlyEdited) { const QVariantMap map = v.toMap(); - if (onlyFlags) { + if (onlyEdited) { m_editedFlags = editedFlagsFromVariant(v); } else { resetEdited(true); diff --git a/src/ui/conf/firewallconf.h b/src/ui/conf/firewallconf.h index c67c1277..cda5ca7d 100644 --- a/src/ui/conf/firewallconf.h +++ b/src/ui/conf/firewallconf.h @@ -130,8 +130,8 @@ public: void copyFlags(const FirewallConf &o); void copy(const FirewallConf &o); - QVariant toVariant(bool onlyFlags = false) const; - void fromVariant(const QVariant &v, bool onlyFlags = false); + QVariant toVariant(bool onlyEdited = false) const; + void fromVariant(const QVariant &v, bool onlyEdited = false); static QVariant editedFlagsToVariant(uint editedFlags); static uint editedFlagsFromVariant(const QVariant &v); diff --git a/src/ui/rpc/confmanagerrpc.cpp b/src/ui/rpc/confmanagerrpc.cpp index 17e268a1..6162e3ff 100644 --- a/src/ui/rpc/confmanagerrpc.cpp +++ b/src/ui/rpc/confmanagerrpc.cpp @@ -115,7 +115,7 @@ bool ConfManagerRpc::saveConf(FirewallConf &newConf) newConf.prepareToSave(); - const QVariant confVar = newConf.toVariant(true); + const QVariant confVar = newConf.toVariant(/*onlyEdited=*/true); setSaving(true); const bool ok = @@ -147,7 +147,7 @@ void ConfManagerRpc::onConfChanged(const QVariant &confVar) loadConf(*conf()); } else { // Apply only flags - conf()->fromVariant(confVar, true); + conf()->fromVariant(confVar, /*onlyEdited=*/true); } if ((editedFlags & FirewallConf::TaskEdited) != 0) {