Add requested source code changes

This commit is contained in:
Vladimir Svyatski 2017-04-21 17:33:06 +03:00
parent dea65b637c
commit 75c16d1cbb
6 changed files with 34 additions and 30 deletions

View file

@ -308,6 +308,22 @@ void Database::recycleGroup(Group* group)
}
}
void Database::emptyRecycleBin()
{
if (m_metadata->recycleBinEnabled() && m_metadata->recycleBin()) {
// destroying direct entries of the recycle bin
QList<Entry*> subEntries = m_metadata->recycleBin()->entries();
for (Entry* entry : subEntries) {
delete entry;
}
// destroying direct subgroups of the recycle bin
QList<Group*> subGroups = m_metadata->recycleBin()->children();
for (Group* group : subGroups) {
delete group;
}
}
}
void Database::merge(const Database* other)
{
m_rootGroup->merge(other->rootGroup());