From 4b6dbcaec4cd8011e4d7374c1dd6892ac671f44d Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Sat, 23 Sep 2017 12:27:06 -0400 Subject: [PATCH] Maintain entry history when merging databases (#970) --- src/core/Group.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/Group.cpp b/src/core/Group.cpp index 94f14f20..a34421e6 100644 --- a/src/core/Group.cpp +++ b/src/core/Group.cpp @@ -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); }