mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-11-29 19:06:55 -05:00
Prevent new entry loss on database file reload
* Fix #3651 * Correct data loss when the database reloads due to a file change while creating a new entry. The issue occurred due to the "new parent group" pointer being invalid after the database is reloaded following merge. * Also fix re-selecting entries following database file reload. If the entry was moved out of the current group it would result in an assert hit. This fix prevents recursively looking for the entry.
This commit is contained in:
parent
b8830dfd32
commit
af263fd80d
3 changed files with 24 additions and 4 deletions
|
|
@ -585,13 +585,18 @@ QList<Entry*> Group::referencesRecursive(const Entry* entry) const
|
|||
[entry](const Entry* e) { return e->hasReferencesTo(entry->uuid()); });
|
||||
}
|
||||
|
||||
Entry* Group::findEntryByUuid(const QUuid& uuid) const
|
||||
Entry* Group::findEntryByUuid(const QUuid& uuid, bool recursive) const
|
||||
{
|
||||
if (uuid.isNull()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
for (Entry* entry : entriesRecursive(false)) {
|
||||
auto entries = m_entries;
|
||||
if (recursive) {
|
||||
entries = entriesRecursive(false);
|
||||
}
|
||||
|
||||
for (auto entry : entries) {
|
||||
if (entry->uuid() == uuid) {
|
||||
return entry;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue