summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2012-04-14 14:13:51 (GMT)
committerMontel Laurent <montel@kde.org>2012-04-14 14:15:26 (GMT)
commit0cb710fa5941b3f2aa0b618358aedb7f6911fd11 (patch)
treeea188ccfd4964006a394c6d4ca769040a96d6d93
parent93d9304a1ea6446004ade818c69092bf5759e900 (diff)
Fix Bug 298083 - Duplicate message conflict due to "Mark selected message as read after" option when opening a message
Use a static list of item. So don't call twice markmessage as read FIXED-IN: 4.8.3 BUG: 298083 (cherry picked from commit 96e0aebc909496e982b627f555610dc4973fc5c1)
-rw-r--r--messageviewer/markmessagereadhandler.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/messageviewer/markmessagereadhandler.cpp b/messageviewer/markmessagereadhandler.cpp
index 2ea0c2f..0136601 100644
--- a/messageviewer/markmessagereadhandler.cpp
+++ b/messageviewer/markmessagereadhandler.cpp
@@ -27,8 +27,8 @@
#include <akonadi/kmime/messageflags.h>
#include <QtCore/QTimer>
-
using namespace MessageViewer;
+K_GLOBAL_STATIC( Akonadi::Item::List, sListItem )
class MarkMessageReadHandler::Private
{
@@ -54,6 +54,7 @@ void MarkMessageReadHandler::Private::handleMessages()
Akonadi::ItemModifyJob *modifyJob = new Akonadi::ItemModifyJob( item, q );
modifyJob->setIgnorePayload( true );
+ sListItem->removeAll(item);
}
@@ -73,11 +74,13 @@ MarkMessageReadHandler::~MarkMessageReadHandler()
void MarkMessageReadHandler::setItem( const Akonadi::Item &item )
{
- if ( d->mItemQueue == item || item.hasFlag(Akonadi::MessageFlags::Queued) )
+ if ( sListItem->contains(item) || d->mItemQueue == item || item.hasFlag(Akonadi::MessageFlags::Queued) )
return;
d->mTimer.stop();
+ sListItem->removeAll(d->mItemQueue);
d->mItemQueue = item;
+ sListItem->append(item);
if ( item.hasFlag( Akonadi::MessageFlags::Seen ) )
return;