Commit 979dddef authored by David Faure's avatar David Faure Committed by Kevin Krammer
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 0b928627
......@@ -601,7 +601,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 (!f.rename( finalKey )) {
qWarning() << "Maildir: Failed to add entry: " << 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