Honor protect parameter when overwriting an attribute/attachment.

This commit is contained in:
Felix Geyer 2012-01-07 16:23:20 +01:00
parent e397080d79
commit f39dfa1c88

View file

@ -258,6 +258,9 @@ void Entry::setAttribute(const QString& key, const QString& value, bool protect)
if (protect) { if (protect) {
m_protectedAttributes.insert(key); m_protectedAttributes.insert(key);
} }
else {
m_protectedAttributes.remove(key);
}
if (isDefaultAttributue(key)) { if (isDefaultAttributue(key)) {
Q_EMIT dataChanged(this); Q_EMIT dataChanged(this);
@ -278,6 +281,9 @@ void Entry::setAttachment(const QString& key, const QByteArray& value, bool prot
if (protect) { if (protect) {
m_protectedAttachments.insert(key); m_protectedAttachments.insert(key);
} }
else {
m_protectedAttachments.remove(key);
}
} }
void Entry::removeAttachment(const QString& key) void Entry::removeAttachment(const QString& key)