mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-27 00:09:53 -05:00
Maintain entry history when merging databases (#970)
This commit is contained in:
parent
8e7fa3d3d6
commit
4b6dbcaec4
@ -667,7 +667,7 @@ void Group::merge(const Group* other)
|
||||
for (Entry* entry : dbEntries) {
|
||||
// entries are searched by uuid
|
||||
if (!findEntryByUuid(entry->uuid())) {
|
||||
entry->clone(Entry::CloneNoFlags)->setGroup(this);
|
||||
entry->clone(Entry::CloneIncludeHistory)->setGroup(this);
|
||||
} else {
|
||||
resolveConflict(findEntryByUuid(entry->uuid()), entry);
|
||||
}
|
||||
@ -891,11 +891,11 @@ void Group::resolveConflict(Entry* existingEntry, Entry* otherEntry)
|
||||
case KeepBoth:
|
||||
// if one entry is newer, create a clone and add it to the group
|
||||
if (timeExisting > timeOther) {
|
||||
clonedEntry = otherEntry->clone(Entry::CloneNoFlags);
|
||||
clonedEntry = otherEntry->clone(Entry::CloneIncludeHistory);
|
||||
clonedEntry->setGroup(this);
|
||||
markOlderEntry(clonedEntry);
|
||||
} else if (timeExisting < timeOther) {
|
||||
clonedEntry = otherEntry->clone(Entry::CloneNoFlags);
|
||||
clonedEntry = otherEntry->clone(Entry::CloneIncludeHistory);
|
||||
clonedEntry->setGroup(this);
|
||||
markOlderEntry(existingEntry);
|
||||
}
|
||||
@ -904,7 +904,7 @@ void Group::resolveConflict(Entry* existingEntry, Entry* otherEntry)
|
||||
if (timeExisting < timeOther) {
|
||||
// only if other entry is newer, replace existing one
|
||||
removeEntry(existingEntry);
|
||||
clonedEntry = otherEntry->clone(Entry::CloneNoFlags);
|
||||
clonedEntry = otherEntry->clone(Entry::CloneIncludeHistory);
|
||||
clonedEntry->setGroup(this);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user