diff --git a/src/ui/conf/firewallconf.cpp b/src/ui/conf/firewallconf.cpp index 153aceb5..fdf08a53 100644 --- a/src/ui/conf/firewallconf.cpp +++ b/src/ui/conf/firewallconf.cpp @@ -173,6 +173,12 @@ void FirewallConf::setAppGroupBits(quint32 groupBits) m_appGroupBits = groupBits; } +void FirewallConf::setupAppGroupBits(quint32 groupBits) +{ + setAppGroupBits(groupBits); + applyAppGroupBits(); +} + bool FirewallConf::appGroupWildcard() const { for (const AppGroup *appGroup : appGroups()) { @@ -353,8 +359,7 @@ void FirewallConf::copyFlags(const FirewallConf &o) m_activePeriodFrom = o.activePeriodFrom(); m_activePeriodTo = o.activePeriodTo(); - m_appGroupBits = o.appGroupBits(); - applyAppGroupBits(); + setupAppGroupBits(o.appGroupBits()); } void FirewallConf::copy(const FirewallConf &o) @@ -433,7 +438,7 @@ void FirewallConf::flagsFromVariant(const QVariant &v) m_activePeriodFrom = map["activePeriodFrom"].toString(); m_activePeriodTo = map["activePeriodTo"].toString(); - m_appGroupBits = map["appGroupBits"].toUInt(); + setupAppGroupBits(map["appGroupBits"].toUInt()); } QVariant FirewallConf::addressesToVariant() const @@ -541,7 +546,6 @@ void FirewallConf::fromVariant(const QVariant &v, bool onlyFlags) if (flagsEdited()) { flagsFromVariant(map["flags"]); - applyAppGroupBits(); } if (iniEdited() || taskEdited()) { diff --git a/src/ui/conf/firewallconf.h b/src/ui/conf/firewallconf.h index 74a7489d..d3c391d5 100644 --- a/src/ui/conf/firewallconf.h +++ b/src/ui/conf/firewallconf.h @@ -106,6 +106,8 @@ public: quint32 appGroupBits() const { return m_appGroupBits; } void setAppGroupBits(quint32 groupBits); + void setupAppGroupBits(quint32 groupBits); + bool appGroupWildcard() const; bool appGroupEnabled(int groupIndex) const; diff --git a/src/ui/fortsettings.cpp b/src/ui/fortsettings.cpp index 8ed169ed..e1184355 100644 --- a/src/ui/fortsettings.cpp +++ b/src/ui/fortsettings.cpp @@ -334,7 +334,7 @@ void FortSettings::readConfIni(FirewallConf &conf) const conf.setLogAlertedBlockedIp(iniBool("logAlertedBlockedIp")); conf.setAppBlockAll(iniBool("appBlockAll", true)); conf.setAppAllowAll(iniBool("appAllowAll")); - conf.setAppGroupBits(iniUInt("appGroupBits", DEFAULT_APP_GROUP_BITS)); + conf.setupAppGroupBits(iniUInt("appGroupBits", DEFAULT_APP_GROUP_BITS)); ini()->endGroup(); ini()->beginGroup("stat");