Create a history item when changing entries.

Closes #15
This commit is contained in:
Felix Geyer 2012-04-23 21:06:04 +02:00
parent 3df2ad35cb
commit e026f3d1eb
9 changed files with 224 additions and 74 deletions

View file

@ -73,22 +73,6 @@ void EntryAttachments::remove(const QString& key)
Q_EMIT modified();
}
void EntryAttachments::copyFrom(const EntryAttachments* other)
{
if (*this != *other) {
Q_EMIT aboutToBeReset();
m_attachments.clear();
Q_FOREACH (const QString& key, other->keys()) {
m_attachments.insert(key, other->value(key));
}
Q_EMIT reset();
Q_EMIT modified();
}
}
void EntryAttachments::clear()
{
if (m_attachments.isEmpty()) {
@ -103,7 +87,26 @@ void EntryAttachments::clear()
Q_EMIT modified();
}
bool EntryAttachments::operator==(const EntryAttachments& other) const
{
return m_attachments == other.m_attachments;
}
bool EntryAttachments::operator!=(const EntryAttachments& other) const
{
return m_attachments != other.m_attachments;
}
EntryAttachments& EntryAttachments::operator=(EntryAttachments& other)
{
if (*this != other) {
Q_EMIT aboutToBeReset();
m_attachments = other.m_attachments;
Q_EMIT reset();
Q_EMIT modified();
}
return *this;
}