From de46e35b8f59742dcbb37d08e3c291ff9cadac10 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 16 Feb 2017 10:31:51 +0100 Subject: Find mime message even if it has been renamed due to a flag change --- examples/maildirresource/libmaildir/maildir.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/examples/maildirresource/libmaildir/maildir.cpp b/examples/maildirresource/libmaildir/maildir.cpp index 079bb10..f7585fe 100644 --- a/examples/maildirresource/libmaildir/maildir.cpp +++ b/examples/maildirresource/libmaildir/maildir.cpp @@ -120,6 +120,21 @@ public: if (QFile::exists(path + QString::fromLatin1("/new/") + key)) { return path + QString::fromLatin1("/new/") + key; } + { + QDir dir(path + QString::fromLatin1("/cur/")); + const QFileInfoList list = dir.entryInfoList(QStringList() << (key+"*"), QDir::Files); + if (!list.isEmpty()) { + return list.first().filePath(); + } + } + + { + QDir dir(path + QString::fromLatin1("/new/")); + const QFileInfoList list = dir.entryInfoList(QStringList() << (key+"*"), QDir::Files); + if (!list.isEmpty()) { + return list.first().filePath(); + } + } return QString(); } -- cgit v1.2.3