mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2026-11-28 04:46:54 -08:00
Minor changes to Group API to make it more explicit
* Include check for group as recycle bin directly into the Group::isRecycled() function * Return the original root group from Database::setRootGroup(...) to force memory management transfer
This commit is contained in:
1 parent
b4ff1fa36c
commit
a02bceabd2
14 files changed
+45
-69
No files matched your search
+4
-6
@@ -223,18 +223,16 @@ Entry* Group::lastTopVisibleEntry() const
|
||||
bool Group::isRecycled() const
|
||||
{
|
||||
auto group = this;
|
||||
if (!group->database()) {
|
||||
if (!group->database() || !group->m_db->metadata()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
do {
|
||||
if (group->m_parent && group->m_db->metadata()) {
|
||||
if (group->m_parent == group->m_db->metadata()->recycleBin()) {
|
||||
return true;
|
||||
}
|
||||
if (group == group->m_db->metadata()->recycleBin()) {
|
||||
return true;
|
||||
}
|
||||
group = group->m_parent;
|
||||
} while (group && group->m_parent && group->m_parent != group->m_db->rootGroup());
|
||||
} while (group);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user