highlight reference field in Database view

This commit is contained in:
thez3ro 2017-03-05 23:47:08 +01:00
parent e91a41401c
commit a03e354504
No known key found for this signature in database
GPG key ID: F628F9E41DD7C073
5 changed files with 52 additions and 3 deletions

View file

@ -69,6 +69,21 @@ bool EntryAttributes::isProtected(const QString& key) const
return m_protectedAttributes.contains(key);
}
bool EntryAttributes::isReference(const QString& key) const
{
if (!m_attributes.contains(key)) {
Q_ASSERT(false);
return false;
}
QString data = value(key);
QRegExp referenceRegExp("\\{REF:([TUPAN])@I:([^}]+)\\}", Qt::CaseInsensitive, QRegExp::RegExp2);
if (referenceRegExp.indexIn(data) != -1) {
return true;
}
return false;
}
void EntryAttributes::set(const QString& key, const QString& value, bool protect)
{
bool emitModified = false;