UI: ConfManagerRpc: Check edited flags.

This commit is contained in:
Nodir Temirkhodjaev 2021-05-14 15:33:18 +03:00
parent 43dde4eab8
commit e063421819
3 changed files with 13 additions and 1 deletions

View File

@ -432,7 +432,7 @@ void FirewallConf::fromVariant(const QVariant &v, bool onlyFlags)
const QVariantMap map = v.toMap();
if (onlyFlags) {
m_editedFlags = map["editedFlags"].toUInt();
m_editedFlags = editedFlagsFromVariant(v);
} else {
resetEdited(true);
}
@ -452,3 +452,9 @@ void FirewallConf::fromVariant(const QVariant &v, bool onlyFlags)
ini().setMap(map["ini"].toMap());
}
}
uint FirewallConf::editedFlagsFromVariant(const QVariant &v)
{
const QVariantMap map = v.toMap();
return map["editedFlags"].toUInt();
}

View File

@ -111,6 +111,8 @@ public:
QVariant toVariant(bool onlyFlags = false) const;
void fromVariant(const QVariant &v, bool onlyFlags = false);
static uint editedFlagsFromVariant(const QVariant &v);
signals:
void logStatChanged();
void appGroupsChanged();

View File

@ -101,6 +101,10 @@ void ConfManagerRpc::onConfChanged(const QVariant &confVar)
{
settings()->clearCache();
const uint editedFlags = FirewallConf::editedFlagsFromVariant(confVar);
if ((editedFlags & (FirewallConf::OptEdited | FirewallConf::FlagsEdited)) == 0)
return;
FirewallConf *newConf = createConf();
newConf->fromVariant(confVar, true);