mirror of
https://github.com/tnodir/fort
synced 2024-11-15 05:18:07 +00:00
UI: FirewallConf::*Variant: Rename param name
This commit is contained in:
parent
b15d80f15b
commit
9270203de4
@ -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) {
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user