Refactor Entry::truncateHistory().
This allows us to drop Entry::getSize() and EntryAttachments::attachmentsSize() which have weird semantics.
This commit is contained in:
@@ -27,6 +27,11 @@ QList<QString> EntryAttachments::keys() const
|
||||
return m_attachments.keys();
|
||||
}
|
||||
|
||||
QList<QByteArray> EntryAttachments::values() const
|
||||
{
|
||||
return m_attachments.values();
|
||||
}
|
||||
|
||||
QByteArray EntryAttachments::value(const QString& key) const
|
||||
{
|
||||
return m_attachments.value(key);
|
||||
@@ -87,21 +92,6 @@ void EntryAttachments::clear()
|
||||
Q_EMIT modified();
|
||||
}
|
||||
|
||||
int EntryAttachments::attachmentsSize(QList<QByteArray>* foundAttachements)
|
||||
{
|
||||
int size = 0;
|
||||
|
||||
QMapIterator<QString, QByteArray> i(m_attachments);
|
||||
while (i.hasNext()) {
|
||||
i.next();
|
||||
if (!foundAttachements->contains(i.value())) {
|
||||
foundAttachements->append(i.value());
|
||||
size += i.value().size();
|
||||
}
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
bool EntryAttachments::operator==(const EntryAttachments& other) const
|
||||
{
|
||||
return m_attachments == other.m_attachments;
|
||||
|
||||
Reference in New Issue
Block a user