Changeset View
Changeset View
Standalone View
Standalone View
src/core/itemsync.cpp
Show First 20 Lines • Show All 151 Lines • ▼ Show 20 Line(s) | 151 | if (mPendingJobs > 0) { | |||
---|---|---|---|---|---|
152 | return; | 152 | return; | ||
153 | } | 153 | } | ||
154 | 154 | | |||
155 | if (mTransactionJobs > 0) { | 155 | if (mTransactionJobs > 0) { | ||
156 | //Commit the current transaction if we're in batch processing mode or done | 156 | //Commit the current transaction if we're in batch processing mode or done | ||
157 | //and wait until the transaction is committed to process the next batch | 157 | //and wait until the transaction is committed to process the next batch | ||
158 | if (mTransactionMode == ItemSync::MultipleTransactions || (mDeliveryDone && mRemoteItemQueue.isEmpty())) { | 158 | if (mTransactionMode == ItemSync::MultipleTransactions || (mDeliveryDone && mRemoteItemQueue.isEmpty())) { | ||
159 | if (mCurrentTransaction) { | 159 | if (mCurrentTransaction) { | ||
160 | // Note that mCurrentTransaction->commit() is a no-op if we're already rolling back | ||||
161 | // so this signal is a bit misleading (but it's only used by unittests it seems) | ||||
160 | Q_EMIT q->transactionCommitted(); | 162 | Q_EMIT q->transactionCommitted(); | ||
161 | mCurrentTransaction->commit(); | 163 | mCurrentTransaction->commit(); | ||
162 | mCurrentTransaction = nullptr; | 164 | mCurrentTransaction = nullptr; | ||
163 | } | 165 | } | ||
164 | return; | 166 | return; | ||
165 | } | 167 | } | ||
166 | } | 168 | } | ||
167 | mProcessingBatch = false; | 169 | mProcessingBatch = false; | ||
▲ Show 20 Lines • Show All 279 Lines • ▼ Show 20 Line(s) | 445 | { | |||
447 | mPendingJobs--; | 449 | mPendingJobs--; | ||
448 | mProgress++; | 450 | mProgress++; | ||
449 | 451 | | |||
450 | checkDone(); | 452 | checkDone(); | ||
451 | } | 453 | } | ||
452 | 454 | | |||
453 | void ItemSyncPrivate::slotLocalChangeDone(KJob *job) | 455 | void ItemSyncPrivate::slotLocalChangeDone(KJob *job) | ||
454 | { | 456 | { | ||
457 | Q_Q(ItemSync); | ||||
455 | if (job->error() && job->error() != Job::KilledJobError) { | 458 | if (job->error() && job->error() != Job::KilledJobError) { | ||
456 | qCWarning(AKONADICORE_LOG) << "Creating/updating items from the akonadi database failed:" << job->errorString(); | 459 | qCWarning(AKONADICORE_LOG) << "Creating/updating items from the akonadi database failed:" << job->errorString(); | ||
460 | mRemoteItemQueue.clear(); // don't try to process any more items after a rollback | ||||
457 | } | 461 | } | ||
458 | mPendingJobs--; | 462 | mPendingJobs--; | ||
459 | mProgress++; | 463 | mProgress++; | ||
460 | 464 | | |||
461 | checkDone(); | 465 | checkDone(); | ||
462 | } | 466 | } | ||
463 | 467 | | |||
464 | void ItemSyncPrivate::slotTransactionResult(KJob *job) | 468 | void ItemSyncPrivate::slotTransactionResult(KJob *job) | ||
▲ Show 20 Lines • Show All 103 Lines • Show Last 20 Lines |