Added history limits enforcement

This commit is contained in:
jacek81 2012-05-04 22:45:34 +01:00 committed by Florian Geyer
parent 860a2131b3
commit 8c87a87da6
6 changed files with 63 additions and 1 deletions

View file

@ -32,6 +32,11 @@ QByteArray EntryAttachments::value(const QString& key) const
return m_attachments.value(key);
}
int EntryAttachments::dataSize(const QString& key)
{
return m_attachments.value(key).size();
}
void EntryAttachments::set(const QString& key, const QByteArray& value)
{
bool emitModified = false;
@ -87,6 +92,15 @@ void EntryAttachments::clear()
Q_EMIT modified();
}
int EntryAttachments::attachmentsSize() {
int size = 0;
Q_FOREACH (const QString& key, keys()) {
size += dataSize(key);
}
return size;
}
bool EntryAttachments::operator==(const EntryAttachments& other) const
{
return m_attachments == other.m_attachments;