Add tests for modified, fix history for autotype

Added tests to ensure #1387 works
Fixed issue detected during testing - AutoTypeAssociations were not
pushed to history
This commit is contained in:
Christian Kieschnick 2018-01-15 18:17:56 +01:00 committed by Janek Bevendorff
parent 045f157a63
commit 943dc6cdd6
No known key found for this signature in database
GPG key ID: 2FDEB0D40BCA5E11
4 changed files with 57 additions and 5 deletions

View file

@ -633,7 +633,7 @@ Entry* Entry::clone(CloneFlags flags) const
entry->m_attributes->set(EntryAttributes::PasswordKey, password.toUpper(), m_attributes->isProtected(EntryAttributes::PasswordKey));
}
entry->m_autoTypeAssociations->copyDataFrom(this->m_autoTypeAssociations);
entry->m_autoTypeAssociations->copyDataFrom(m_autoTypeAssociations);
if (flags & CloneIncludeHistory) {
for (Entry* historyItem : m_history) {
Entry* historyItemClone = historyItem->clone(flags & ~CloneIncludeHistory & ~CloneNewUuid);
@ -679,6 +679,7 @@ void Entry::beginUpdate()
m_tmpHistoryItem->m_data = m_data;
m_tmpHistoryItem->m_attributes->copyDataFrom(m_attributes);
m_tmpHistoryItem->m_attachments->copyDataFrom(m_attachments);
m_tmpHistoryItem->m_autoTypeAssociations->copyDataFrom(m_autoTypeAssociations);
m_modifiedSinceBegin = false;
}