mirror of
https://github.com/tnodir/fort
synced 2024-11-15 08:15:10 +00:00
UI: ConfManagerRpc: Check edited flags.
This commit is contained in:
parent
43dde4eab8
commit
e063421819
@ -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();
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user