mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-08-24 05:59:37 -04:00
Handle deleting groups more consistently.
Delete the entries and child groups in Group dtor no what if the group has a database or not.
This commit is contained in:
parent
7be87051ab
commit
72d17c045f
1 changed files with 12 additions and 12 deletions
|
@ -40,19 +40,19 @@ Group::~Group()
|
||||||
this->blockSignals(true);
|
this->blockSignals(true);
|
||||||
// Destroy entries and children manually so DeletedObjects can be added
|
// Destroy entries and children manually so DeletedObjects can be added
|
||||||
// to database.
|
// to database.
|
||||||
|
QList<Entry*> entries = m_entries;
|
||||||
|
Q_FOREACH (Entry* entry, entries) {
|
||||||
|
entry->blockSignals(true);
|
||||||
|
delete entry;
|
||||||
|
}
|
||||||
|
|
||||||
|
QList<Group*> children = m_children;
|
||||||
|
Q_FOREACH (Group* group, children) {
|
||||||
|
group->blockSignals(true);
|
||||||
|
delete group;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_db && m_parent) {
|
if (m_db && m_parent) {
|
||||||
QList<Entry*> entries = m_entries;
|
|
||||||
Q_FOREACH (Entry* entry, entries) {
|
|
||||||
entry->blockSignals(true);
|
|
||||||
delete entry;
|
|
||||||
}
|
|
||||||
|
|
||||||
QList<Group*> children = m_children;
|
|
||||||
Q_FOREACH (Group* group, children) {
|
|
||||||
group->blockSignals(true);
|
|
||||||
delete group;
|
|
||||||
}
|
|
||||||
|
|
||||||
DeletedObject delGroup;
|
DeletedObject delGroup;
|
||||||
delGroup.deletionTime = Tools::currentDateTimeUtc();
|
delGroup.deletionTime = Tools::currentDateTimeUtc();
|
||||||
delGroup.uuid = m_uuid;
|
delGroup.uuid = m_uuid;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue