Mailcommon
searchrulenumerical.cpp
21SearchRuleNumerical::SearchRuleNumerical(const QByteArray &field, Function func, const QString &contents)
60 QString msg = (rc ? QStringLiteral("<font color=#00FF00>1 = </font>") : QStringLiteral("<font color=#FF0000>0 = </font>"));
62 msg += QLatin1StringView(" ( <i>") + QString::number(numericalMsgContents) + QLatin1StringView("</i> )");
73bool SearchRuleNumerical::matchesInternal(long numericalValue, long numericalMsgContents, const QString &msgContents) const
89 return msgContents.contains(QRegularExpression(contents(), QRegularExpression::CaseInsensitiveOption));
92 return !msgContents.contains(QRegularExpression(contents(), QRegularExpression::CaseInsensitiveOption));
118void SearchRuleNumerical::addQueryTerms(Akonadi::SearchTerm &groupTerm, bool &emptyIsNotAnError) const
qint64 size() const
bool hasPayload() const
T payload() const
void addSubTerm(const SearchTerm &term)
void setIsNegated(bool negated)
void add(const QString &entry, ContentType type)
Adds the given log entry under the given content type to the log.
Definition filterlog.cpp:128
static QString recode(const QString &plain)
Returns an escaped version of the log which can be used in a HTML document.
Definition filterlog.cpp:188
static FilterLog * instance()
Returns the single global instance of the filter log.
Definition filterlog.cpp:71
bool matches(const Akonadi::Item &item) const override
Tries to match the rule against the KMime::Message in the given item.
Definition searchrulenumerical.cpp:34
void addQueryTerms(Akonadi::SearchTerm &groupTerm, bool &emptyIsNotAnError) const override
Adds query terms to the given term group.
Definition searchrulenumerical.cpp:118
RequiredPart requiredPart() const override
Returns the required part from the item that is needed for the search to operate.
Definition searchrulenumerical.cpp:68
bool isEmpty() const override
Determines whether the rule is worth considering.
Definition searchrulenumerical.cpp:26
SearchRuleNumerical(const QByteArray &field=QByteArray(), Function function=FuncContains, const QString &contents=QString())
Creates new numerical search rule.
Definition searchrulenumerical.cpp:21
bool matchesInternal(long numericalValue, long numericalContents, const QString &contents) const
A helper method for the main matches() method.
Definition searchrulenumerical.cpp:73
QByteArray field() const
Returns the message header field name (without the trailing ':').
Definition searchrule.cpp:501
Akonadi::SearchTerm::Condition akonadiComparator() const
Converts the rule function into the corresponding Akonadi query operator.
Definition searchrule.cpp:525
bool isNegated() const
Helper that returns whether the rule has a negated function.
Definition searchrule.cpp:566
const QString asString() const
Returns the rule as string for debugging purpose.
Definition searchrule.cpp:516
QString i18n(const char *text, const TYPE &arg...)
QDate addDays(qint64 ndays) const const
QDate currentDate()
QDateTime currentDateTime()
QDate date() const const
qint64 daysTo(const QDateTime &other) const const
CaseInsensitiveOption
bool contains(QChar ch, Qt::CaseSensitivity cs) const const
QString number(double n, char format, int precision)
int toInt(bool *ok, int base) const const
qlonglong toLongLong(bool *ok, int base) const const
CaseInsensitive
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:09:01 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:09:01 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.