diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-01-07 18:58:19 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-01-07 18:58:19 +0100 |
commit | 4603487f087fc9d15b3919d55d651e434fa3cc6a (patch) | |
tree | 4f834646f9b5cee686ebc60ab74d845b29277e40 /examples/imapresource/imapserverproxy.cpp | |
parent | 3aab8be81f96e8a32a1edc09b836e6c0264d39e7 (diff) | |
download | sink-4603487f087fc9d15b3919d55d651e434fa3cc6a.tar.gz sink-4603487f087fc9d15b3919d55d651e434fa3cc6a.zip |
No more normalizedPath
Diffstat (limited to 'examples/imapresource/imapserverproxy.cpp')
-rw-r--r-- | examples/imapresource/imapserverproxy.cpp | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/examples/imapresource/imapserverproxy.cpp b/examples/imapresource/imapserverproxy.cpp index d6f0c7f..af1f4d1 100644 --- a/examples/imapresource/imapserverproxy.cpp +++ b/examples/imapresource/imapserverproxy.cpp | |||
@@ -396,25 +396,22 @@ KAsync::Job<void> ImapServerProxy::fetchFolders(std::function<void(const Folder | |||
396 | 396 | ||
397 | QString ImapServerProxy::mailboxFromFolder(const Folder &folder) const | 397 | QString ImapServerProxy::mailboxFromFolder(const Folder &folder) const |
398 | { | 398 | { |
399 | if (folder.path().isEmpty()) { | 399 | Q_ASSERT(!folder.path().isEmpty()); |
400 | return folder.path(mPersonalNamespaceSeparator); | 400 | return folder.path(); |
401 | } else { | ||
402 | return folder.path(); | ||
403 | } | ||
404 | } | 401 | } |
405 | 402 | ||
406 | KAsync::Job<SelectResult> ImapServerProxy::fetchFlags(const Folder &folder, const KIMAP2::ImapSet &set, qint64 changedsince, std::function<void(const Message &)> callback) | 403 | KAsync::Job<SelectResult> ImapServerProxy::fetchFlags(const Folder &folder, const KIMAP2::ImapSet &set, qint64 changedsince, std::function<void(const Message &)> callback) |
407 | { | 404 | { |
408 | SinkTrace() << "Fetching flags " << folder.normalizedPath(); | 405 | SinkTrace() << "Fetching flags " << folder.path(); |
409 | return select(mailboxFromFolder(folder)).then<SelectResult, SelectResult>([=](const SelectResult &selectResult) -> KAsync::Job<SelectResult> { | 406 | return select(mailboxFromFolder(folder)).then<SelectResult, SelectResult>([=](const SelectResult &selectResult) -> KAsync::Job<SelectResult> { |
410 | SinkTrace() << "Modeseq " << folder.normalizedPath() << selectResult.highestModSequence << changedsince; | 407 | SinkTrace() << "Modeseq " << folder.path() << selectResult.highestModSequence << changedsince; |
411 | 408 | ||
412 | if (selectResult.highestModSequence == static_cast<quint64>(changedsince)) { | 409 | if (selectResult.highestModSequence == static_cast<quint64>(changedsince)) { |
413 | SinkTrace()<< folder.normalizedPath() << "Changedsince didn't change, nothing to do."; | 410 | SinkTrace()<< folder.path() << "Changedsince didn't change, nothing to do."; |
414 | return KAsync::value<SelectResult>(selectResult); | 411 | return KAsync::value<SelectResult>(selectResult); |
415 | } | 412 | } |
416 | 413 | ||
417 | SinkTrace() << "Fetching flags " << folder.normalizedPath() << set << selectResult.highestModSequence << changedsince; | 414 | SinkTrace() << "Fetching flags " << folder.path() << set << selectResult.highestModSequence << changedsince; |
418 | 415 | ||
419 | KIMAP2::FetchJob::FetchScope scope; | 416 | KIMAP2::FetchJob::FetchScope scope; |
420 | scope.mode = KIMAP2::FetchJob::FetchScope::Flags; | 417 | scope.mode = KIMAP2::FetchJob::FetchScope::Flags; |
@@ -432,15 +429,15 @@ KAsync::Job<void> ImapServerProxy::fetchMessages(const Folder &folder, qint64 ui | |||
432 | time->start(); | 429 | time->start(); |
433 | Q_ASSERT(!mPersonalNamespaceSeparator.isNull()); | 430 | Q_ASSERT(!mPersonalNamespaceSeparator.isNull()); |
434 | return select(mailboxFromFolder(folder)).then<void, SelectResult>([this, callback, folder, time, progress, uidNext](const SelectResult &selectResult) -> KAsync::Job<void> { | 431 | return select(mailboxFromFolder(folder)).then<void, SelectResult>([this, callback, folder, time, progress, uidNext](const SelectResult &selectResult) -> KAsync::Job<void> { |
435 | SinkTrace() << "UIDNEXT " << folder.normalizedPath() << selectResult.uidNext << uidNext; | 432 | SinkTrace() << "UIDNEXT " << folder.path() << selectResult.uidNext << uidNext; |
436 | if (selectResult.uidNext == (uidNext + 1)) { | 433 | if (selectResult.uidNext == (uidNext + 1)) { |
437 | SinkTrace()<< folder.normalizedPath() << "Uidnext didn't change, nothing to do."; | 434 | SinkTrace()<< folder.path() << "Uidnext didn't change, nothing to do."; |
438 | return KAsync::null<void>(); | 435 | return KAsync::null<void>(); |
439 | } | 436 | } |
440 | 437 | ||
441 | SinkTrace() << "Fetching messages from " << folder.normalizedPath() << selectResult.uidNext << uidNext; | 438 | SinkTrace() << "Fetching messages from " << folder.path() << selectResult.uidNext << uidNext; |
442 | return fetchHeaders(mailboxFromFolder(folder), (uidNext + 1)).then<void, QVector<qint64>>([this, callback, time, progress, folder](const QVector<qint64> &uidsToFetch){ | 439 | return fetchHeaders(mailboxFromFolder(folder), (uidNext + 1)).then<void, QVector<qint64>>([this, callback, time, progress, folder](const QVector<qint64> &uidsToFetch){ |
443 | SinkTrace() << "Fetched headers" << folder.normalizedPath(); | 440 | SinkTrace() << "Fetched headers" << folder.path(); |
444 | SinkTrace() << " Total: " << uidsToFetch.size(); | 441 | SinkTrace() << " Total: " << uidsToFetch.size(); |
445 | SinkTrace() << " Uids to fetch: " << uidsToFetch; | 442 | SinkTrace() << " Uids to fetch: " << uidsToFetch; |
446 | SinkTrace() << " Took: " << Sink::Log::TraceTime(time->elapsed()); | 443 | SinkTrace() << " Took: " << Sink::Log::TraceTime(time->elapsed()); |
@@ -457,7 +454,7 @@ KAsync::Job<void> ImapServerProxy::fetchMessages(const Folder &folder, const QVe | |||
457 | Q_ASSERT(!mPersonalNamespaceSeparator.isNull()); | 454 | Q_ASSERT(!mPersonalNamespaceSeparator.isNull()); |
458 | return select(mailboxFromFolder(folder)).then<void, SelectResult>([this, callback, folder, time, progress, uidsToFetch](const SelectResult &selectResult) -> KAsync::Job<void> { | 455 | return select(mailboxFromFolder(folder)).then<void, SelectResult>([this, callback, folder, time, progress, uidsToFetch](const SelectResult &selectResult) -> KAsync::Job<void> { |
459 | 456 | ||
460 | SinkTrace() << "Fetching messages" << folder.normalizedPath(); | 457 | SinkTrace() << "Fetching messages" << folder.path(); |
461 | SinkTrace() << " Total: " << uidsToFetch.size(); | 458 | SinkTrace() << " Total: " << uidsToFetch.size(); |
462 | SinkTrace() << " Uids to fetch: " << uidsToFetch; | 459 | SinkTrace() << " Uids to fetch: " << uidsToFetch; |
463 | auto totalCount = uidsToFetch.size(); | 460 | auto totalCount = uidsToFetch.size(); |