diff options
Diffstat (limited to 'examples/maildirresource/maildirresource.cpp')
-rw-r--r-- | examples/maildirresource/maildirresource.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/examples/maildirresource/maildirresource.cpp b/examples/maildirresource/maildirresource.cpp index 40bab37..b406f63 100644 --- a/examples/maildirresource/maildirresource.cpp +++ b/examples/maildirresource/maildirresource.cpp | |||
@@ -43,8 +43,6 @@ | |||
43 | #define ENTITY_TYPE_MAIL "mail" | 43 | #define ENTITY_TYPE_MAIL "mail" |
44 | #define ENTITY_TYPE_FOLDER "folder" | 44 | #define ENTITY_TYPE_FOLDER "folder" |
45 | 45 | ||
46 | SINK_DEBUG_AREA("maildirresource") | ||
47 | |||
48 | using namespace Sink; | 46 | using namespace Sink; |
49 | 47 | ||
50 | static QString getFilePathFromMimeMessagePath(const QString &mimeMessagePath) | 48 | static QString getFilePathFromMimeMessagePath(const QString &mimeMessagePath) |
@@ -555,18 +553,20 @@ MaildirResource::MaildirResource(const Sink::ResourceContext &resourceContext) | |||
555 | setupPreprocessors(ENTITY_TYPE_FOLDER, QVector<Sink::Preprocessor*>() << new FolderPreprocessor(mMaildirPath)); | 553 | setupPreprocessors(ENTITY_TYPE_FOLDER, QVector<Sink::Preprocessor*>() << new FolderPreprocessor(mMaildirPath)); |
556 | 554 | ||
557 | KPIM::Maildir dir(mMaildirPath, true); | 555 | KPIM::Maildir dir(mMaildirPath, true); |
558 | SinkTrace() << "Started maildir resource for maildir: " << mMaildirPath; | 556 | if (dir.isValid(false)) { |
559 | { | 557 | { |
560 | auto draftsFolder = dir.addSubFolder("Drafts"); | 558 | auto draftsFolder = dir.addSubFolder("Drafts"); |
561 | auto remoteId = synchronizer->createFolder(draftsFolder, "folder", QByteArrayList() << "drafts"); | 559 | auto remoteId = synchronizer->createFolder(draftsFolder, "folder", QByteArrayList() << "drafts"); |
562 | auto draftsFolderLocalId = synchronizer->syncStore().resolveRemoteId(ENTITY_TYPE_FOLDER, remoteId); | 560 | auto draftsFolderLocalId = synchronizer->syncStore().resolveRemoteId(ENTITY_TYPE_FOLDER, remoteId); |
563 | } | 561 | } |
564 | { | 562 | { |
565 | auto trashFolder = dir.addSubFolder("Trash"); | 563 | auto trashFolder = dir.addSubFolder("Trash"); |
566 | auto remoteId = synchronizer->createFolder(trashFolder, "folder", QByteArrayList() << "trash"); | 564 | auto remoteId = synchronizer->createFolder(trashFolder, "folder", QByteArrayList() << "trash"); |
567 | auto trashFolderLocalId = synchronizer->syncStore().resolveRemoteId(ENTITY_TYPE_FOLDER, remoteId); | 565 | auto trashFolderLocalId = synchronizer->syncStore().resolveRemoteId(ENTITY_TYPE_FOLDER, remoteId); |
566 | } | ||
567 | synchronizer->commit(); | ||
568 | } | 568 | } |
569 | synchronizer->commit(); | 569 | SinkTrace() << "Started maildir resource for maildir: " << mMaildirPath; |
570 | } | 570 | } |
571 | 571 | ||
572 | 572 | ||