Commit 9101a561 authored by David Faure's avatar David Faure
Browse files

Fix mail loss when the file on disk has an inconsistent name.

E.g. status in akonadi was "unread" but the file on disk had the "Seen"
flag, so marking it as read doesn't need to rename the file, it already
has the desired final name.

BUG: 289428
FIXED-IN: 4.8.1
parent c5fa16ce
......@@ -602,7 +602,12 @@ QString Maildir::changeEntryFlags(const QString& key, const Akonadi::Item::Flags
QString newUniqueKey = finalKey; //key without path
finalKey.prepend( d->path + QString::fromLatin1("/cur/") );
if( realKey == finalKey ) {
// Somehow it already is named this way (e.g. migration bug -> wrong status in akonadi)
return newUniqueKey;
}
QFile f( realKey );
if (QFile::exists(finalKey)) {
QFile destFile(finalKey);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment