[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdepim-runtime/KDE/4.7] resources/maildir/libmaildir: Fix mail loss when the file on disk has an in
From:       Kevin Krammer <kevin.krammer () gmx ! at>
Date:       2012-02-11 10:44:09
Message-ID: 20120211104409.6B16AA60A6 () git ! kde ! org
[Download RAW message or body]

Git commit 979dddef125dfde91a4e060bf6f51a9916e55a66 by Kevin Krammer, on \
behalf of David Faure. Committed on 11/02/2012 at 11:34.
Pushed by krake into branch 'KDE/4.7'.

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

M  +6    -1    resources/maildir/libmaildir/maildir.cpp

http://commits.kde.org/kdepim-runtime/979dddef125dfde91a4e060bf6f51a9916e55a66


diff --git a/resources/maildir/libmaildir/maildir.cpp \
b/resources/maildir/libmaildir/maildir.cpp index 414e826..2dbc8f0 100644
--- a/resources/maildir/libmaildir/maildir.cpp
+++ b/resources/maildir/libmaildir/maildir.cpp
@@ -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  << \
"!";


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic