summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-09-13 13:27:48 +0200
committerMontel Laurent <[email protected]>2017-09-13 13:27:58 +0200
commit36bae129a0219ee34c6ba346a2e44c05aebe3527 (patch)
tree9993ec5088d6a1a79faef6a0150dbd30579cdac3
parent5780ce51a2ccd4f7877365f31fd678c1a41bbbc4 (diff)
Minor optimization
-rw-r--r--resources/imap/changeitemtask.cpp2
-rw-r--r--resources/imap/changeitemtask.h4
-rw-r--r--resources/imap/searchtask.cpp12
3 files changed, 10 insertions, 8 deletions
diff --git a/resources/imap/changeitemtask.cpp b/resources/imap/changeitemtask.cpp
index ecd1931..32f0976 100644
--- a/resources/imap/changeitemtask.cpp
+++ b/resources/imap/changeitemtask.cpp
@@ -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)
{
}
diff --git a/resources/imap/changeitemtask.h b/resources/imap/changeitemtask.h
index 286bfbd..b4fcd84 100644
--- a/resources/imap/changeitemtask.h
+++ b/resources/imap/changeitemtask.h
@@ -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
diff --git a/resources/imap/searchtask.cpp b/resources/imap/searchtask.cpp
index 36f6f51..7ee67eb 100644
--- a/resources/imap/searchtask.cpp
+++ b/resources/imap/searchtask.cpp
@@ -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: