8#include "filteractionsetstatus.h"
9#include "mailcommon_debug.h"
10#include <Akonadi/MessageStatus>
11#include <KLocalizedString>
16 return new FilterActionSetStatus;
19FilterActionSetStatus::FilterActionSetStatus(QObject *parent)
20 : FilterActionStatus(QStringLiteral(
"set status"),
i18n(
"Mark As"), parent)
24bool FilterActionSetStatus::isEmpty()
const
26 const int index = mParameterList.indexOf(mParameter);
30QString FilterActionSetStatus::informationAboutNotValidAction()
const
32 return i18n(
"Status not specified.");
37 const int index = mParameterList.indexOf(mParameter);
42 Akonadi::MessageStatus
status;
45 Akonadi::MessageStatus oldStatus =
status;
46 const Akonadi::MessageStatus newStatus = FilterActionStatus::statuses[index - 1];
65QString FilterActionSetStatus::sieveCode()
const
69 if (parameter == QLatin1Char(
'R')) {
70 flagCode = QStringLiteral(
"\\\\Seen");
71 }
else if (parameter == QLatin1Char(
'D')) {
72 flagCode = QStringLiteral(
"\\\\Deleted");
73 }
else if (parameter == QLatin1Char(
'A')) {
74 flagCode = QStringLiteral(
"\\\\Answered");
76 qCDebug(MAILCOMMON_LOG) <<
" FilterActionSetStatus::sieveCode() unknown flags" << parameter;
80 const QString result = QStringLiteral(
"setflag \"%1\";").arg(flagCode);
84QStringList FilterActionSetStatus::sieveRequires()
const
86 return QStringList() << QStringLiteral(
"imap4flags");
89#include "moc_filteractionsetstatus.cpp"
void setFlags(const Flags &flags)
static const MessageStatus statusUnread()
Abstract base class for mail filter actions.
virtual QString argsAsString() const =0
Return extra arguments as string.
ReturnCode
Describes the possible return codes of filter processing:
@ ErrorButGoOn
A non-critical error occurred.
@ GoOn
Go on with applying filter actions.
A helper class for the filtering process.
Akonadi::Item & item()
Returns the item of the context.
void setNeedsFlagStore()
Marks that the item's flags has been changed and needs to be written back.
RequiredPart
Possible required parts.
Q_SCRIPTABLE CaptureState status()
QString i18n(const char *text, const TYPE &arg...)