diff --git a/src/ui/conf/firewallconf.cpp b/src/ui/conf/firewallconf.cpp index 0f83e973..0c86a627 100644 --- a/src/ui/conf/firewallconf.cpp +++ b/src/ui/conf/firewallconf.cpp @@ -459,7 +459,7 @@ QVariant FirewallConf::toVariant(bool onlyFlags) const { QVariantMap map; - const uint flags = onlyFlags ? editedFlags() : AllEdited; + const EditedFlags flags = onlyFlags ? editedFlags() : AllEdited; if (onlyFlags) { map = editedFlagsToVariant(flags).toMap(); diff --git a/src/ui/conf/firewallconf.h b/src/ui/conf/firewallconf.h index f82d40ab..ca906351 100644 --- a/src/ui/conf/firewallconf.h +++ b/src/ui/conf/firewallconf.h @@ -16,16 +16,17 @@ class FirewallConf : public QObject public: enum EditedFlag { NoneEdited = 0, - OptEdited = 0x01, - FlagsEdited = 0x02, - IniEdited = 0x04, - TaskEdited = 0x10, + OptEdited = (1 << 0), + FlagsEdited = (1 << 1), + IniEdited = (1 << 2), + TaskEdited = (1 << 3), AllEdited = (OptEdited | FlagsEdited | IniEdited | TaskEdited) }; + Q_DECLARE_FLAGS(EditedFlags, EditedFlag) explicit FirewallConf(Settings *settings = nullptr, QObject *parent = nullptr); - uint editedFlags() const { return m_editedFlags; } + EditedFlags editedFlags() const { return EditedFlags(m_editedFlags); } bool optEdited() const { return (m_editedFlags & OptEdited) != 0; } void setOptEdited() { m_editedFlags |= OptEdited; } @@ -196,4 +197,6 @@ private: IniOptions m_ini; }; +Q_DECLARE_OPERATORS_FOR_FLAGS(FirewallConf::EditedFlags) + #endif // FIREWALLCONF_H