Fix code-style issues

Fixed issues pointed out during review
This commit is contained in:
Christian Kieschnick 2018-01-16 08:34:56 +01:00 committed by Janek Bevendorff
parent 943dc6cdd6
commit 258438f01f
No known key found for this signature in database
GPG key ID: 2FDEB0D40BCA5E11
6 changed files with 24 additions and 24 deletions

View file

@ -586,6 +586,7 @@ void Entry::truncateHistory()
QMutableListIterator<Entry*> i(m_history);
i.toBack();
const QRegularExpression delimiter(",|:|;");
while (i.hasPrevious()) {
Entry* historyItem = i.previous();
@ -594,7 +595,8 @@ void Entry::truncateHistory()
size += historyItem->attributes()->attributesSize();
size += historyItem->autoTypeAssociations()->associationsSize();
size += historyItem->attachments()->attachmentsSize(foundAttachments);
foreach( const QString &tag, historyItem->tags().split(QRegExp(",|;|:"), QString::SkipEmptyParts)){
const QStringList tags = historyItem->tags().split(delimiter, QString::SkipEmptyParts);
for (const QString& tag : tags) {
size += tag.toUtf8().size();
}
foundAttachments += historyItem->attachments()->values();