Commit 36bae129 authored by Laurent Montel's avatar Laurent Montel 😁

Minor optimization

parent 5780ce51
......@@ -37,7 +37,7 @@
#include "uidnextattribute.h"
ChangeItemTask::ChangeItemTask(const ResourceStateInterface::Ptr &resource, QObject *parent)
: ResourceTask(DeferIfNoSession, resource, parent), m_session(nullptr), m_oldUid(0), m_newUid(0)
: ResourceTask(DeferIfNoSession, resource, parent)
{
}
......
......@@ -54,8 +54,8 @@ private:
KIMAP::Session *m_session = nullptr;
QByteArray m_messageId;
qint64 m_oldUid;
qint64 m_newUid;
qint64 m_oldUid = 0;
qint64 m_newUid = 0;
};
#endif
......@@ -153,20 +153,22 @@ static KIMAP::Term recursiveEmailTermMapping(const Akonadi::SearchTerm &term)
return KIMAP::Term(KIMAP::Term::Cc, term.value().toString()).setNegated(term.isNegated());
case Akonadi::EmailSearchTerm::HeaderBCC:
return KIMAP::Term(KIMAP::Term::Bcc, term.value().toString()).setNegated(term.isNegated());
case Akonadi::EmailSearchTerm::MessageStatus:
if (term.value().toString() == QString::fromLatin1(Akonadi::MessageFlags::Flagged)) {
case Akonadi::EmailSearchTerm::MessageStatus: {
const QString termStr = term.value().toString();
if (termStr == QString::fromLatin1(Akonadi::MessageFlags::Flagged)) {
return KIMAP::Term(KIMAP::Term::Flagged).setNegated(term.isNegated());
}
if (term.value().toString() == QString::fromLatin1(Akonadi::MessageFlags::Deleted)) {
if (termStr == QString::fromLatin1(Akonadi::MessageFlags::Deleted)) {
return KIMAP::Term(KIMAP::Term::Deleted).setNegated(term.isNegated());
}
if (term.value().toString() == QString::fromLatin1(Akonadi::MessageFlags::Replied)) {
if (termStr == QString::fromLatin1(Akonadi::MessageFlags::Replied)) {
return KIMAP::Term(KIMAP::Term::Answered).setNegated(term.isNegated());
}
if (term.value().toString() == QString::fromLatin1(Akonadi::MessageFlags::Seen)) {
if (termStr == QString::fromLatin1(Akonadi::MessageFlags::Seen)) {
return KIMAP::Term(KIMAP::Term::Seen).setNegated(term.isNegated());
}
break;
}
case Akonadi::EmailSearchTerm::MessageTag:
break;
case Akonadi::EmailSearchTerm::HeaderReplyTo:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment