mirror of
https://github.com/tnodir/fort
synced 2024-11-15 08:56:22 +00:00
UI: FirewallConf: Improve EditedFlags
This commit is contained in:
parent
3cb713331b
commit
9e0e1a13c6
@ -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();
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user