From f39dfa1c88354cda87335d818fe55c007ab6574f Mon Sep 17 00:00:00 2001 From: Felix Geyer Date: Sat, 7 Jan 2012 16:23:20 +0100 Subject: [PATCH] Honor protect parameter when overwriting an attribute/attachment. --- src/core/Entry.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/Entry.cpp b/src/core/Entry.cpp index 16268549..b35c201d 100644 --- a/src/core/Entry.cpp +++ b/src/core/Entry.cpp @@ -258,6 +258,9 @@ void Entry::setAttribute(const QString& key, const QString& value, bool protect) if (protect) { m_protectedAttributes.insert(key); } + else { + m_protectedAttributes.remove(key); + } if (isDefaultAttributue(key)) { Q_EMIT dataChanged(this); @@ -278,6 +281,9 @@ void Entry::setAttachment(const QString& key, const QByteArray& value, bool prot if (protect) { m_protectedAttachments.insert(key); } + else { + m_protectedAttachments.remove(key); + } } void Entry::removeAttachment(const QString& key)