Mailcommon
searchrule.cpp
75 SearchRule::Ptr SearchRule::createInstance(const QByteArray &field, Function func, const QString &contents)
93 SearchRule::Ptr SearchRule::createInstance(const QByteArray &field, const char *func, const QString &contents)
112 Function func2 = configValueToFunc(config.readEntry(func + cIdx, QString()).toLatin1().constData());
285 code += QLatin1Char('"') + i18n("\"%1\" is not supported with condition \"%2\"", QLatin1String(mField), conditionToString(mFunction))
289 code += QStringLiteral("size %1 %2K").arg(comparison).arg(QString::number(mContents.toInt() + offset));
392 code += QLatin1Char('"') + i18n("\"%1\" is not supported with condition \"%2\"", QLatin1String(mField), conditionToString(mFunction))
396 code += (negative ? QStringLiteral("not ") : QString()) + QStringLiteral("body :text %1 \"%2\"").arg(comparison, contentStr);
474 code += QLatin1Char('"') + i18n("\"%1\" is not supported with condition \"%2\"", QLatin1String(mField), conditionToString(mFunction))
479 + QStringLiteral("header %1 \"%2\" \"%3\"").arg(comparison).arg(QLatin1String(mField)).arg(contentStr);
QString number(int n, int base)
This class represents a search to be performed against the status of a message.
Definition: searchrulestatus.h:23
bool isNegated() const
Helper that returns whether the rule has a negated function.
Definition: searchrule.cpp:563
This class represents a search pattern rule operating on numerical values.
Definition: searchrulenumerical.h:19
bool contains(const QString &str, Qt::CaseSensitivity cs) const const
static SearchRule::Ptr createInstanceFromConfig(const KConfigGroup &group, int index)
Creates a new search rule from a given config group.
Definition: searchrule.cpp:103
Akonadi::SearchTerm::Condition akonadiComparator() const
Converts the rule function into the corresponding Akonadi query operator.
Definition: searchrule.cpp:522
QString i18n(const char *text, const TYPE &arg...)
static SearchRule::Ptr createInstance(const QByteArray &field=QByteArray(), Function function=FuncContains, const QString &contents=QString())
Creates a new search rule of a certain type by instantiating the appropriate subclass depending on th...
Definition: searchrule.cpp:75
int toInt(bool *ok, int base) const const
KSharedConfigPtr config()
QString arg(qlonglong a, int fieldWidth, int base, QChar fillChar) const const
QString fromLatin1(const char *str, int size)
void setField(const QByteArray &name)
Sets the message header field name.
Definition: searchrule.cpp:493
void setFunction(Function function)
Sets the filter function of the rule.
Definition: searchrule.cpp:483
void setContents(const QString &contents)
Set the contents of the rule.
Definition: searchrule.cpp:503
const SearchRule & operator=(const SearchRule &other)
Initializes this rule with an other rule.
Definition: searchrule.cpp:62
void writeConfig(KConfigGroup &group, int index) const
Saves the object into a given config group.
Definition: searchrule.cpp:160
const QString asString() const
Returns the rule as string for debugging purpose.
Definition: searchrule.cpp:513
SearchRule(const QByteArray &field=QByteArray(), Function function=FuncContains, const QString &contents=QString())
Creates new new search rule.
Definition: searchrule.cpp:51
QByteArray field() const
Returns the message header field name (without the trailing ':').
Definition: searchrule.cpp:498
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Nov 28 2023 03:59:05 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Nov 28 2023 03:59:05 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.