UI: FirewallConf: Simplify checkDeprecatedAppGroups()

This commit is contained in:
Nodir Temirkhodjaev 2024-02-06 19:46:54 +03:00
parent 744fcc68ea
commit d91ebb6b96
2 changed files with 6 additions and 2 deletions

View File

@ -79,6 +79,11 @@ public:
QString allowText() const { return m_allowText; } QString allowText() const { return m_allowText; }
void setAllowText(const QString &allowText); void setAllowText(const QString &allowText);
bool hasAnyText() const
{
return !killText().isEmpty() || !blockText().isEmpty() || !allowText().isEmpty();
}
QString periodFrom() const { return m_periodFrom; } QString periodFrom() const { return m_periodFrom; }
void setPeriodFrom(const QString &periodFrom); void setPeriodFrom(const QString &periodFrom);

View File

@ -197,8 +197,7 @@ AppGroup *FirewallConf::appGroupByName(const QString &name) const
bool FirewallConf::checkDeprecatedAppGroups() const bool FirewallConf::checkDeprecatedAppGroups() const
{ {
for (AppGroup *appGroup : appGroups()) { for (AppGroup *appGroup : appGroups()) {
if (!appGroup->killText().isEmpty() || !appGroup->blockText().isEmpty() if (appGroup->hasAnyText())
|| !appGroup->allowText().isEmpty())
return false; return false;
} }
return true; return true;