diff options
Diffstat (limited to 'examples/imapresource/imapserverproxy.cpp')
-rw-r--r-- | examples/imapresource/imapserverproxy.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/examples/imapresource/imapserverproxy.cpp b/examples/imapresource/imapserverproxy.cpp index b27ffb0..a5a64db 100644 --- a/examples/imapresource/imapserverproxy.cpp +++ b/examples/imapresource/imapserverproxy.cpp | |||
@@ -244,6 +244,11 @@ KAsync::Job<SelectResult> ImapServerProxy::select(const QString &mailbox) | |||
244 | }); | 244 | }); |
245 | } | 245 | } |
246 | 246 | ||
247 | KAsync::Job<SelectResult> ImapServerProxy::select(const Folder &folder) | ||
248 | { | ||
249 | return select(mailboxFromFolder(folder)); | ||
250 | } | ||
251 | |||
247 | KAsync::Job<qint64> ImapServerProxy::append(const QString &mailbox, const QByteArray &content, const QList<QByteArray> &flags, const QDateTime &internalDate) | 252 | KAsync::Job<qint64> ImapServerProxy::append(const QString &mailbox, const QByteArray &content, const QList<QByteArray> &flags, const QDateTime &internalDate) |
248 | { | 253 | { |
249 | auto append = new KIMAP2::AppendJob(mSession); | 254 | auto append = new KIMAP2::AppendJob(mSession); |
@@ -577,7 +582,7 @@ QString ImapServerProxy::mailboxFromFolder(const Folder &folder) const | |||
577 | KAsync::Job<SelectResult> ImapServerProxy::fetchFlags(const Folder &folder, const KIMAP2::ImapSet &set, qint64 changedsince, std::function<void(const Message &)> callback) | 582 | KAsync::Job<SelectResult> ImapServerProxy::fetchFlags(const Folder &folder, const KIMAP2::ImapSet &set, qint64 changedsince, std::function<void(const Message &)> callback) |
578 | { | 583 | { |
579 | SinkTrace() << "Fetching flags " << folder.path(); | 584 | SinkTrace() << "Fetching flags " << folder.path(); |
580 | return select(mailboxFromFolder(folder)).then<SelectResult, SelectResult>([=](const SelectResult &selectResult) -> KAsync::Job<SelectResult> { | 585 | return select(folder).then<SelectResult, SelectResult>([=](const SelectResult &selectResult) -> KAsync::Job<SelectResult> { |
581 | SinkTrace() << "Modeseq " << folder.path() << selectResult.highestModSequence << changedsince; | 586 | SinkTrace() << "Modeseq " << folder.path() << selectResult.highestModSequence << changedsince; |
582 | 587 | ||
583 | if (selectResult.highestModSequence == static_cast<quint64>(changedsince)) { | 588 | if (selectResult.highestModSequence == static_cast<quint64>(changedsince)) { |
@@ -601,7 +606,7 @@ KAsync::Job<void> ImapServerProxy::fetchMessages(const Folder &folder, qint64 ui | |||
601 | { | 606 | { |
602 | auto time = QSharedPointer<QTime>::create(); | 607 | auto time = QSharedPointer<QTime>::create(); |
603 | time->start(); | 608 | time->start(); |
604 | return select(mailboxFromFolder(folder)).then<void, SelectResult>([this, callback, folder, time, progress, uidNext](const SelectResult &selectResult) -> KAsync::Job<void> { | 609 | return select(folder).then<void, SelectResult>([this, callback, folder, time, progress, uidNext](const SelectResult &selectResult) -> KAsync::Job<void> { |
605 | SinkTrace() << "UIDNEXT " << folder.path() << selectResult.uidNext << uidNext; | 610 | SinkTrace() << "UIDNEXT " << folder.path() << selectResult.uidNext << uidNext; |
606 | if (selectResult.uidNext == (uidNext + 1)) { | 611 | if (selectResult.uidNext == (uidNext + 1)) { |
607 | SinkTrace()<< folder.path() << "Uidnext didn't change, nothing to do."; | 612 | SinkTrace()<< folder.path() << "Uidnext didn't change, nothing to do."; |
@@ -624,7 +629,7 @@ KAsync::Job<void> ImapServerProxy::fetchMessages(const Folder &folder, const QVe | |||
624 | { | 629 | { |
625 | auto time = QSharedPointer<QTime>::create(); | 630 | auto time = QSharedPointer<QTime>::create(); |
626 | time->start(); | 631 | time->start(); |
627 | return select(mailboxFromFolder(folder)).then<void, SelectResult>([this, callback, folder, time, progress, uidsToFetch, headersOnly](const SelectResult &selectResult) -> KAsync::Job<void> { | 632 | return select(folder).then<void, SelectResult>([this, callback, folder, time, progress, uidsToFetch, headersOnly](const SelectResult &selectResult) -> KAsync::Job<void> { |
628 | 633 | ||
629 | SinkTrace() << "Fetching messages" << folder.path(); | 634 | SinkTrace() << "Fetching messages" << folder.path(); |
630 | SinkTrace() << " Total: " << uidsToFetch.size(); | 635 | SinkTrace() << " Total: " << uidsToFetch.size(); |