From d91ebb6b96b7be04b338d5e7c78bb3cb429d4960 Mon Sep 17 00:00:00 2001 From: Nodir Temirkhodjaev Date: Tue, 6 Feb 2024 19:46:54 +0300 Subject: [PATCH] UI: FirewallConf: Simplify checkDeprecatedAppGroups() --- src/ui/conf/appgroup.h | 5 +++++ src/ui/conf/firewallconf.cpp | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ui/conf/appgroup.h b/src/ui/conf/appgroup.h index 1c7abd25..40de2c2b 100644 --- a/src/ui/conf/appgroup.h +++ b/src/ui/conf/appgroup.h @@ -79,6 +79,11 @@ public: QString allowText() const { return m_allowText; } void setAllowText(const QString &allowText); + bool hasAnyText() const + { + return !killText().isEmpty() || !blockText().isEmpty() || !allowText().isEmpty(); + } + QString periodFrom() const { return m_periodFrom; } void setPeriodFrom(const QString &periodFrom); diff --git a/src/ui/conf/firewallconf.cpp b/src/ui/conf/firewallconf.cpp index 6173b5bb..fb93f867 100644 --- a/src/ui/conf/firewallconf.cpp +++ b/src/ui/conf/firewallconf.cpp @@ -197,8 +197,7 @@ AppGroup *FirewallConf::appGroupByName(const QString &name) const bool FirewallConf::checkDeprecatedAppGroups() const { for (AppGroup *appGroup : appGroups()) { - if (!appGroup->killText().isEmpty() || !appGroup->blockText().isEmpty() - || !appGroup->allowText().isEmpty()) + if (appGroup->hasAnyText()) return false; } return true;