reuse referenceRegExp

This commit is contained in:
thez3ro 2017-03-07 17:19:41 +01:00
parent a03e354504
commit 40851409fb
No known key found for this signature in database
GPG key ID: F628F9E41DD7C073
3 changed files with 10 additions and 3 deletions

View file

@ -28,6 +28,7 @@ const QString EntryAttributes::RememberCmdExecAttr = "_EXEC_CMD";
EntryAttributes::EntryAttributes(QObject* parent)
: QObject(parent)
, m_referenceRegExp("\\{REF:([TUPAN])@I:([^}]+)\\}", Qt::CaseInsensitive, QRegExp::RegExp2)
{
clear();
}
@ -77,13 +78,17 @@ bool EntryAttributes::isReference(const QString& key) const
}
QString data = value(key);
QRegExp referenceRegExp("\\{REF:([TUPAN])@I:([^}]+)\\}", Qt::CaseInsensitive, QRegExp::RegExp2);
if (referenceRegExp.indexIn(data) != -1) {
if (m_referenceRegExp.indexIn(data) != -1) {
return true;
}
return false;
}
QRegExp EntryAttributes::referenceRegExp() const
{
return m_referenceRegExp;
}
void EntryAttributes::set(const QString& key, const QString& value, bool protect)
{
bool emitModified = false;