mirror of
https://github.com/tnodir/fort
synced 2024-11-15 11:35:07 +00:00
UI: FirewallConf: Simplify toVariant().
This commit is contained in:
parent
60d80bbed5
commit
8e3440511a
@ -406,23 +406,26 @@ QVariant FirewallConf::toVariant(bool onlyFlags) const
|
|||||||
{
|
{
|
||||||
QVariantMap map;
|
QVariantMap map;
|
||||||
|
|
||||||
|
const uint flags = onlyFlags ? editedFlags() : AllEdited;
|
||||||
|
|
||||||
if (onlyFlags) {
|
if (onlyFlags) {
|
||||||
map = editedFlagsToVariant(m_editedFlags).toMap();
|
map = editedFlagsToVariant(flags).toMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!onlyFlags || optEdited()) {
|
if ((flags & OptEdited) != 0) {
|
||||||
map["addressGroups"] = addressesToVariant();
|
map["addressGroups"] = addressesToVariant();
|
||||||
map["appGroups"] = appGroupsToVariant();
|
map["appGroups"] = appGroupsToVariant();
|
||||||
map["removedAppGroupIdList"] = removedAppGroupIdListToVariant();
|
map["removedAppGroupIdList"] = removedAppGroupIdListToVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!onlyFlags || flagsEdited()) {
|
if ((flags & FlagsEdited) != 0) {
|
||||||
map["flags"] = flagsToVariant();
|
map["flags"] = flagsToVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!onlyFlags || iniEdited()) {
|
if ((flags & IniEdited) != 0) {
|
||||||
if (!ini().map().isEmpty()) {
|
const auto map = ini().map();
|
||||||
map["ini"] = ini().map();
|
if (!map.isEmpty()) {
|
||||||
|
map["ini"] = map;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user