File fix_mail_filter.diff of Package kdepim4

Subject: fix the email duplication when filtering
From: Andras Mantia <amantia@kde.org>
Bug: bnc#770012
Patch-upstream: kde >= 4.8.5


commit 8846d44b217108351c35f8afd883f72ee88388ec
Author: Andras Mantia <amantia@kde.org>
Date:   Fri Jul 6 12:12:34 2012 +0300

    Backport part of the filter fix: this is the actual fix, the rest were optimizations and safety checks, but it is difficult to backport.
    An unwanted side-effect might be that more data is downloaded than before,
    based on the type of filters used.
    
    FIXED-IN: 4.8.5
    CCBUG: 287752
    CCBUG: 292283
    CCBUG: 288109
    CCBUG: 286043
    CCBUG: 295484
    CCBUG: 302337
    CCBUG: 295000
    CCBUG: 295684
    CCBUG: 293768
    CCBUG: 275233
    CCBUG: 293918
    CCBUG: 284310
    CCBUG: 286364
    CCBUG: 283682

diff --git a/mailfilteragent/mailfilteragent.cpp b/mailfilteragent/mailfilteragent.cpp
index 79b2f9d..5f66e74 100644
--- a/mailfilteragent/mailfilteragent.cpp
+++ b/mailfilteragent/mailfilteragent.cpp
@@ -110,7 +110,6 @@ void MailFilterAgent::initialCollectionFetchingDone( KJob *job )
   Akonadi::CollectionFetchJob *fetchJob = qobject_cast<Akonadi::CollectionFetchJob*>( job );
 
   changeRecorder()->itemFetchScope().setAncestorRetrieval( Akonadi::ItemFetchScope::Parent );
-  changeRecorder()->itemFetchScope().setCacheOnly( true );
   if (m_filterManager->requiresFullMailBody()) {
     changeRecorder()->itemFetchScope().fetchFullPayload();
   } else {