summaryrefslogtreecommitdiffstats
path: root/examples/maildirresource
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-02-01 13:14:14 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-02-01 13:14:14 +0100
commit2f0605ded80cd4c216b8cbaaf228e98811207744 (patch)
tree98206b6ff9d5e277fdeb606693a4e05a48adba8f /examples/maildirresource
parent0b233494a69b5e9cd86e91c60016a294e6c9ef50 (diff)
downloadsink-2f0605ded80cd4c216b8cbaaf228e98811207744.tar.gz
sink-2f0605ded80cd4c216b8cbaaf228e98811207744.zip
Ensure maildir flagchanges work completely
Diffstat (limited to 'examples/maildirresource')
-rw-r--r--examples/maildirresource/libmaildir/maildir.cpp2
-rw-r--r--examples/maildirresource/libmaildir/maildir.h2
-rw-r--r--examples/maildirresource/maildirresource.cpp12
3 files changed, 14 insertions, 2 deletions
diff --git a/examples/maildirresource/libmaildir/maildir.cpp b/examples/maildirresource/libmaildir/maildir.cpp
index 3d4630f..f8ca606 100644
--- a/examples/maildirresource/libmaildir/maildir.cpp
+++ b/examples/maildirresource/libmaildir/maildir.cpp
@@ -560,7 +560,7 @@ QDateTime Maildir::lastModified(const QString& key) const
560 return info.lastModified(); 560 return info.lastModified();
561} 561}
562 562
563QByteArray Maildir::readEntryHeadersFromFile(const QString& file) const 563QByteArray Maildir::readEntryHeadersFromFile(const QString& file)
564{ 564{
565 QByteArray result; 565 QByteArray result;
566 566
diff --git a/examples/maildirresource/libmaildir/maildir.h b/examples/maildirresource/libmaildir/maildir.h
index a89a832..42d53e6 100644
--- a/examples/maildirresource/libmaildir/maildir.h
+++ b/examples/maildirresource/libmaildir/maildir.h
@@ -184,7 +184,7 @@ public:
184 * Return the contents of the headers section of the file the maildir with the given @p file, that 184 * Return the contents of the headers section of the file the maildir with the given @p file, that
185 * is a full path to the file. You can get it by using findRealKey(key) . 185 * is a full path to the file. You can get it by using findRealKey(key) .
186 */ 186 */
187 QByteArray readEntryHeadersFromFile( const QString& file ) const; 187 static QByteArray readEntryHeadersFromFile( const QString& file );
188 188
189 /** 189 /**
190 * Return the contents of the headers section of the file the maildir with the given @p key. 190 * Return the contents of the headers section of the file the maildir with the given @p key.
diff --git a/examples/maildirresource/maildirresource.cpp b/examples/maildirresource/maildirresource.cpp
index 33883a7..922eb5a 100644
--- a/examples/maildirresource/maildirresource.cpp
+++ b/examples/maildirresource/maildirresource.cpp
@@ -311,6 +311,18 @@ KAsync::Job<void> MaildirResource::inspect(int inspectionType, const QByteArray
311 } 311 }
312 return KAsync::null<void>(); 312 return KAsync::null<void>();
313 } 313 }
314 if (property == "subject") {
315 const auto remoteId = resolveLocalId(ENTITY_TYPE_MAIL, entityId, synchronizationTransaction);
316
317 KMime::Message *msg = new KMime::Message;
318 msg->setHead(KMime::CRLFtoLF(KPIM::Maildir::readEntryHeadersFromFile(remoteId)));
319 msg->parse();
320
321 if (msg->subject(true)->asUnicodeString() != expectedValue.toString()) {
322 return KAsync::error<void>(1, "Subject not as expected.");
323 }
324 return KAsync::null<void>();
325 }
314 } 326 }
315 if (inspectionType == Sink::Resources::Inspection::ExistenceInspectionType) { 327 if (inspectionType == Sink::Resources::Inspection::ExistenceInspectionType) {
316 const auto remoteId = resolveLocalId(ENTITY_TYPE_MAIL, entityId, synchronizationTransaction); 328 const auto remoteId = resolveLocalId(ENTITY_TYPE_MAIL, entityId, synchronizationTransaction);