13 const QString &category)
14 : m_severity(severity), m_msgText(text.trimmed()), m_category(category.trimmed())
17 this->
m_valid = !((severity == CStatusMessage::SeverityInfo || severity == CStatusMessage::SeverityDebug) &&
18 m_msgText.isEmpty() && m_category.isEmpty());
23 if (!this->
isValid()) {
return inContainer; }
27 if (!(m_severity == CStatusMessage::SeverityInfo || m_severity == CStatusMessage::SeverityDebug))
29 if (!msg.isSeverityHigherOrEqual(this->m_severity)) {
continue; }
32 if (!this->m_msgText.isEmpty())
37 if (!this->m_category.isEmpty())
53 if (!m_category.contains(
'*'))
55 if (CLogPattern::allHumanReadableNames().contains(m_category))
57 return CVariant::from(CLogPattern::fromHumanReadableName(m_category).withSeverityAtOrAbove(m_severity));
59 return CVariant::from(CLogPattern::exactMatch(m_category).withSeverityAtOrAbove(m_severity));
62 CLogCategoryList categories = CLogCategoryList::fromQStringList(CLogCategories::allSpecialCategories());
69 auto humanCats = humanNames.
transform([](
const QString &name) {
70 const auto strings = CLogPattern::fromHumanReadableName(name).getCategoryStrings();
71 return strings.isEmpty() ? QString {} : *strings.begin();
74 return CVariant::from(CLogPattern::anyOf(categories.
join(humanCats)).withSeverityAtOrAbove(m_severity));
virtual swift::misc::CVariant getAsValueObject() const
Return an implementation-specific value object representing the filter.
virtual swift::misc::CStatusMessageList filter(const swift::misc::CStatusMessageList &inContainer) const
Used container data.
bool m_valid
is filter valid?
bool stringMatchesFilterExpression(const QString &value, const QString &filter, Qt::CaseSensitivity cs=Qt::CaseInsensitive) const
Standard string search supporting wildcard at begin and end: "*xyz", "abc*".
bool isValid() const
Anything to do?
A log category is an arbitrary string tag which can be attached to log messages.
A sequence of log categories.
auto transform(F function) const
Return a new container generated by applying some transformation function to all elements of this one...
Generic sequential container with value semantics.
int removeIf(Predicate p)
Remove elements for which a given predicate returns true.
void push_back(const T &value)
Appends an element at the end of the sequence.
CSequence join(const CSequence &other) const
Concatenates two sequences and returns the result.
Streamable status message, e.g.
Status messages, e.g. from Core -> GUI.
Wrapper around QVariant which provides transparent access to CValueObject methods of the contained ob...
QString toQString(bool i18n=false) const
Cast as QString.
Models to be used with views, mainly QTableView.
Free functions in swift::misc.
StatusSeverity
Status severities.