summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Koller <[email protected]>2017-04-29 22:02:42 +0200
committerMartin Koller <[email protected]>2017-04-29 22:02:42 +0200
commitbed145318d8eb1f5e0ded801d3d2ec8c74a2ae2f (patch)
treeedbabfe0c752cf0ff54816c1b3bec10352550dce
parent62cca94ac075eb3d6def3b6d22e81c1ee8a9bdc6 (diff)
Avoid KDirWatch problem not stopping watching a dir when told
Differential Revision: https://phabricator.kde.org/D5653
-rw-r--r--resources/maildir/maildirresource.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/resources/maildir/maildirresource.cpp b/resources/maildir/maildirresource.cpp
index 63aabc6..8863f78 100644
--- a/resources/maildir/maildirresource.cpp
+++ b/resources/maildir/maildirresource.cpp
@@ -213,6 +213,7 @@ bool MaildirResource::retrieveItems(const Akonadi::Item::List &items, const QSet
rv.reserve(items.count());
for (const Akonadi::Item &item : items) {
const QByteArray data = md.readEntry(item.remoteId());
+
KMime::Message *mail = new KMime::Message();
mail->setContent(KMime::CRLFtoLF(data));
mail->parse();
@@ -878,15 +879,15 @@ QString MaildirResource::maildirPathForCollection(const Collection &collection)
void MaildirResource::stopMaildirScan(const Maildir &maildir)
{
const QString path = maildir.path();
- mFsWatcher->stopDirScan(path + QLatin1Literal("/new"));
- mFsWatcher->stopDirScan(path + QLatin1Literal("/cur"));
+ mFsWatcher->removeDir(path + QLatin1Literal("/new"));
+ mFsWatcher->removeDir(path + QLatin1Literal("/cur"));
}
void MaildirResource::restartMaildirScan(const Maildir &maildir)
{
const QString path = maildir.path();
- mFsWatcher->restartDirScan(path + QLatin1Literal("/new"));
- mFsWatcher->restartDirScan(path + QLatin1Literal("/cur"));
+ mFsWatcher->addDir(path + QLatin1Literal("/new"));
+ mFsWatcher->addDir(path + QLatin1Literal("/cur"));
}
void MaildirResource::changedCleaner()