Improve history limits.

Closes #16
This commit is contained in:
Florian Geyer 2012-05-10 09:56:41 +02:00
parent 8c87a87da6
commit 1a74feb253
6 changed files with 54 additions and 38 deletions

View file

@ -36,11 +36,6 @@ QString EntryAttributes::value(const QString& key) const
return m_attributes.value(key);
}
int EntryAttributes::valueSize(const QString& key)
{
return m_attributes.value(key).size() * sizeof(QChar);
}
bool EntryAttributes::isProtected(const QString& key) const
{
return m_protectedAttributes.contains(key);
@ -231,8 +226,10 @@ void EntryAttributes::clear()
int EntryAttributes::attributesSize() {
int size = 0;
Q_FOREACH (const QString& key, keys()) {
size += valueSize(key);
QMapIterator<QString, QString> i(m_attributes);
while (i.hasNext()) {
i.next();
size += i.value().toUtf8().size();
}
return size;
}