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

List:       kde-commits
Subject:    [kdepim-runtime/KDE/4.7] resources/maildir: Fix TransactionSequence
From:       Volker Krause <vkrause () kde ! org>
Date:       2011-10-16 11:17:33
Message-ID: 20111016111733.86816A60A6 () git ! kde ! org
[Download RAW message or body]

Git commit 4201f680ca1be87f584f70807a9944a524f3d236 by Volker Krause.
Committed on 13/10/2011 at 16:27.
Pushed by vkrause into branch 'KDE/4.7'.

Fix TransactionSequence usage here.

When adding jobs after a event-loop reentrance, we cannot rely on auto-
committing. This caused the maildir resource to hang during syncs if there
were changes on disk, probably exposed by the recent optimizations in
maildir and yesterday's fixes in TransactionSequence.
(cherry picked from commit fb588dce93fd2c0defa7e1dcdea1e5ff2634d395)

M  +3    -0    resources/maildir/retrieveitemsjob.cpp

http://commits.kde.org/kdepim-runtime/4201f680ca1be87f584f70807a9944a524f3d236

diff --git a/resources/maildir/retrieveitemsjob.cpp b/resources/maildir/retrieveitemsjob.cpp
index 56d961f..89c3e0e 100644
--- a/resources/maildir/retrieveitemsjob.cpp
+++ b/resources/maildir/retrieveitemsjob.cpp
@@ -146,6 +146,8 @@ void RetrieveItemsJob::entriesProcessed()
   
   if ( !m_transaction ) // no jobs created here -> done
     emitResult();
+  else
+    m_transaction->commit();
 }
 
 
@@ -154,6 +156,7 @@ Akonadi::TransactionSequence* RetrieveItemsJob::transaction()
 {
   if ( !m_transaction ) {
     m_transaction = new Akonadi::TransactionSequence( this );
+    m_transaction->setAutomaticCommittingEnabled( false );
     connect( m_transaction, SIGNAL(result(KJob*)), SLOT(transactionDone(KJob*)) );
   }
   return m_transaction;

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

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