Use CustomData for storing excluded groups

This isn't part of the kdbx format so we can't write it there directly.
This commit is contained in:
Agoston Szepessy 2025-12-22 20:30:07 -08:00
parent c75a6887d3
commit 316ea082b9
2 changed files with 3 additions and 7 deletions

View file

@ -46,7 +46,6 @@ Group::Group()
m_data.autoTypeEnabled = Inherit;
m_data.searchingEnabled = Inherit;
m_data.mergeMode = Default;
m_data.excludeFromReports = false;
connect(m_customData, &CustomData::modified, this, &Group::modified);
connect(this, &Group::modified, this, &Group::updateTimeinfo);
@ -1284,12 +1283,13 @@ void Group::setPreviousParentGroup(const Group* group)
void Group::setExcludeFromReports(bool excluded)
{
set(m_data.excludeFromReports, excluded);
customData()->set(CustomData::ExcludeFromReportsLegacy, excluded ? TRUE_STR : FALSE_STR);
}
bool Group::excludeFromReports() const
{
return m_data.excludeFromReports;
return customData()->contains(CustomData::ExcludeFromReportsLegacy)
&& customData()->value(CustomData::ExcludeFromReportsLegacy) == TRUE_STR;
}
bool Group::GroupData::operator==(const Group::GroupData& other) const
@ -1338,8 +1338,5 @@ bool Group::GroupData::equals(const Group::GroupData& other, CompareItemOptions
if (::compare(mergeMode, other.mergeMode, options) != 0) {
return false;
}
if (::compare(excludeFromReports, other.excludeFromReports, options) != 0) {
return false;
}
return true;
}

View file

@ -68,7 +68,6 @@ public:
Group::MergeMode mergeMode;
QString tags;
QUuid previousParentGroupUuid;
bool excludeFromReports;
bool operator==(const GroupData& other) const;
bool operator!=(const GroupData& other) const;