mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-11-27 01:56:32 -05:00
Refactor Entry::truncateHistory().
This allows us to drop Entry::getSize() and EntryAttachments::attachmentsSize() which have weird semantics.
This commit is contained in:
parent
0c1fecfb2b
commit
ef579cbe3c
4 changed files with 16 additions and 27 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue