UI: FirewallConf::*Variant: Rename param name

This commit is contained in:
Nodir Temirkhodjaev 2023-12-23 13:31:40 +03:00
parent b15d80f15b
commit 9270203de4
4 changed files with 11 additions and 11 deletions

View File

@ -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) {

View File

@ -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);

View File

@ -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);

View File

@ -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) {