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

@ -36,6 +36,11 @@ 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);
@ -223,6 +228,15 @@ void EntryAttributes::clear()
Q_EMIT modified();
}
int EntryAttributes::attributesSize() {
int size = 0;
Q_FOREACH (const QString& key, keys()) {
size += valueSize(key);
}
return size;
}
bool EntryAttributes::isDefaultAttribute(const QString& key)
{
return DEFAULT_ATTRIBUTES.contains(key);