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

List:       kde-commits
Subject:    KDE/kdepimlibs/akonadi/kmime
From:       Tobias Koenig <tokoe () kde ! org>
Date:       2010-11-09 14:44:43
Message-ID: 20101109144443.93D3EAC89B () svn ! kde ! org
[Download RAW message or body]

SVN commit 1194701 by tokoe:

Use ignorePayload when doing a flag update


 M  +5 -10     markascommand.cpp  


--- trunk/KDE/kdepimlibs/akonadi/kmime/markascommand.cpp #1194700:1194701
@@ -100,15 +100,10 @@
 void MarkAsCommand::markMessages()
 {
   mMarkJobCount = 0;
-  //NOTE(Andras): from kmail/kmmcommands, KMSetStatusCommand
+
   foreach( const Akonadi::Item &it, mMessages ) {
-    // HACK here we create a new item with an empty payload---
-    //  just the Id, revision, and new flags, because otherwise
-    //  non-symmetric assemble/parser in KMime might make the payload
-    //  different than the original mail, and cause extra copies to be
-    //  created on the server.
-    Akonadi::Item item( it.id() );
-    item.setRevision( it.revision() );
+    Akonadi::Item item( it );
+
     // Set a custom flag
     Akonadi::MessageStatus itemStatus;
     itemStatus.setStatusFromFlags( it.flags() );
@@ -124,15 +119,15 @@
     } else {
       itemStatus.set( mTargetStatus );
     }
-      /*if ( itemStatus != oldStatus )*/ {
+
       item.setFlags( itemStatus.statusFlags() );
       // Store back modified item
       Akonadi::ItemModifyJob *modifyJob = new Akonadi::ItemModifyJob( item, this );
+    modifyJob->ignorePayload();
       mMarkJobCount++;
       connect( modifyJob, SIGNAL( result( KJob* ) ), this, SLOT( slotModifyItemDone( KJob* ) ) );
     }
   }
-}
 
 void MarkAsCommand::slotModifyItemDone( KJob * job )
 {
[prev in list] [next in list] [prev in thread] [next in thread] 

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