• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.14.10 API Reference
  • KDE Home
  • Contact Us
 

akonadi

  • akonadi
itemsync.cpp
1/*
2 Copyright (c) 2007 Tobias Koenig <tokoe@kde.org>
3 Copyright (c) 2007 Volker Krause <vkrause@kde.org>
4 Copyright (c) 2014 Christian Mollekopf <mollekopf@kolabsys.com>
5
6 This library is free software; you can redistribute it and/or modify it
7 under the terms of the GNU Library General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or (at your
9 option) any later version.
10
11 This library is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
14 License for more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to the
18 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 02110-1301, USA.
20*/
21
22#include "itemsync.h"
23
24#include "job_p.h"
25#include "collection.h"
26#include "item.h"
27#include "item_p.h"
28#include "itemcreatejob.h"
29#include "itemdeletejob.h"
30#include "itemfetchjob.h"
31#include "itemmodifyjob.h"
32#include "transactionsequence.h"
33#include "itemfetchscope.h"
34
35#include <kdebug.h>
36
37#include <QtCore/QStringList>
38
39using namespace Akonadi;
40
44class Akonadi::ItemSyncPrivate : public JobPrivate
45{
46public:
47 ItemSyncPrivate(ItemSync *parent)
48 : JobPrivate(parent)
49 , mTransactionMode(ItemSync::SingleTransaction)
50 , mCurrentTransaction(0)
51 , mTransactionJobs(0)
52 , mPendingJobs(0)
53 , mProgress(0)
54 , mTotalItems(-1)
55 , mTotalItemsProcessed(0)
56 , mStreaming(false)
57 , mIncremental(false)
58 , mDeliveryDone(false)
59 , mFinished(false)
60 , mFullListingDone(false)
61 , mProcessingBatch(false)
62 , mDisableAutomaticDeliveryDone(false)
63 , mBatchSize(10)
64 , mMergeMode(Akonadi::ItemSync::RIDMerge)
65 {
66 // we want to fetch all data by default
67 mFetchScope.fetchFullPayload();
68 mFetchScope.fetchAllAttributes();
69 }
70
71 void createOrMerge(const Item &item);
72 void checkDone();
73 void slotItemsReceived(const Item::List &items);
74 void slotLocalListDone(KJob *job);
75 void slotLocalDeleteDone(KJob *);
76 void slotLocalChangeDone(KJob *job);
77 void execute();
78 void processItems();
79 void processBatch();
80 void deleteItems(const Item::List &items);
81 void slotTransactionResult(KJob *job);
82 void requestTransaction();
83 Job *subjobParent() const;
84 void fetchLocalItemsToDelete();
85 QString jobDebuggingString() const /*Q_DECL_OVERRIDE*/;
86 bool allProcessed() const;
87
88 Q_DECLARE_PUBLIC(ItemSync)
89 Collection mSyncCollection;
90 QSet<QString> mListedItems;
91
92 ItemSync::TransactionMode mTransactionMode;
93 TransactionSequence *mCurrentTransaction;
94 int mTransactionJobs;
95
96 // fetch scope for initial item listing
97 ItemFetchScope mFetchScope;
98
99 Akonadi::Item::List mRemoteItemQueue;
100 Akonadi::Item::List mRemovedRemoteItemQueue;
101 Akonadi::Item::List mCurrentBatchRemoteItems;
102 Akonadi::Item::List mCurrentBatchRemovedRemoteItems;
103 Akonadi::Item::List mItemsToDelete;
104
105 // create counter
106 int mPendingJobs;
107 int mProgress;
108 int mTotalItems;
109 int mTotalItemsProcessed;
110
111 bool mStreaming;
112 bool mIncremental;
113 bool mDeliveryDone;
114 bool mFinished;
115 bool mFullListingDone;
116 bool mProcessingBatch;
117 bool mDisableAutomaticDeliveryDone;
118
119 int mBatchSize;
120 Akonadi::ItemSync::MergeMode mMergeMode;
121};
122
123void ItemSyncPrivate::createOrMerge(const Item &item)
124{
125 Q_Q(ItemSync);
126 // don't try to do anything in error state
127 if (q->error()) {
128 return;
129 }
130 mPendingJobs++;
131 ItemCreateJob *create = new ItemCreateJob(item, mSyncCollection, subjobParent());
132 ItemCreateJob::MergeOptions merge = ItemCreateJob::Silent;
133 if (mMergeMode == ItemSync::GIDMerge && !item.gid().isEmpty()) {
134 merge |= ItemCreateJob::GID;
135 } else {
136 merge |= ItemCreateJob::RID;
137 }
138 create->setMerge(merge);
139 q->connect(create, SIGNAL(result(KJob*)), q, SLOT(slotLocalChangeDone(KJob*)));
140}
141
142bool ItemSyncPrivate::allProcessed() const
143{
144 return mDeliveryDone && mCurrentBatchRemoteItems.isEmpty() && mRemoteItemQueue.isEmpty() && mRemovedRemoteItemQueue.isEmpty() && mCurrentBatchRemovedRemoteItems.isEmpty();
145}
146
147void ItemSyncPrivate::checkDone()
148{
149 Q_Q(ItemSync);
150 q->setProcessedAmount(KJob::Bytes, mProgress);
151 if (mPendingJobs > 0) {
152 return;
153 }
154
155 if (mTransactionJobs > 0) {
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
158 if (mTransactionMode == ItemSync::MultipleTransactions || (mDeliveryDone && mRemoteItemQueue.isEmpty())) {
159 if (mCurrentTransaction) {
160 q->emit transactionCommitted();
161 mCurrentTransaction->commit();
162 mCurrentTransaction = 0;
163 }
164 return;
165 }
166 }
167 mProcessingBatch = false;
168 if (!mRemoteItemQueue.isEmpty()) {
169 execute();
170 //We don't have enough items, request more
171 if (!mProcessingBatch) {
172 q->emit readyForNextBatch(mBatchSize - mRemoteItemQueue.size());
173 }
174 return;
175 }
176 q->emit readyForNextBatch(mBatchSize);
177
178 if (allProcessed() && !mFinished) {
179 // prevent double result emission, can happen since checkDone() is called from all over the place
180 mFinished = true;
181 q->emitResult();
182 }
183}
184
185ItemSync::ItemSync(const Collection &collection, QObject *parent)
186 : Job(new ItemSyncPrivate(this), parent)
187{
188 Q_D(ItemSync);
189 d->mSyncCollection = collection;
190}
191
192ItemSync::~ItemSync()
193{
194}
195
196void ItemSync::setFullSyncItems(const Item::List &items)
197{
198 /*
199 * We received a list of items from the server:
200 * * fetch all local id's + rid's only
201 * * check each full sync item wether it's locally available
202 * * if it is modify the item
203 * * if it's not create it
204 * * delete all superfluous items
205 */
206 Q_D(ItemSync);
207 Q_ASSERT(!d->mIncremental);
208 if (!d->mStreaming) {
209 d->mDeliveryDone = true;
210 }
211 d->mRemoteItemQueue += items;
212 d->mTotalItemsProcessed += items.count();
213 kDebug() << "Received: " << items.count() << "In total: " << d->mTotalItemsProcessed << " Wanted: " << d->mTotalItems;
214 if (!d->mDisableAutomaticDeliveryDone && (d->mTotalItemsProcessed == d->mTotalItems)) {
215 d->mDeliveryDone = true;
216 }
217 d->execute();
218}
219
220void ItemSync::setTotalItems(int amount)
221{
222 Q_D(ItemSync);
223 Q_ASSERT(!d->mIncremental);
224 Q_ASSERT(amount >= 0);
225 setStreamingEnabled(true);
226 kDebug() << amount;
227 d->mTotalItems = amount;
228 setTotalAmount(KJob::Bytes, amount);
229 if (!d->mDisableAutomaticDeliveryDone && (d->mTotalItems == 0)) {
230 d->mDeliveryDone = true;
231 d->execute();
232 }
233}
234
235void ItemSync::setDisableAutomaticDeliveryDone(bool disable)
236{
237 Q_D(ItemSync);
238 d->mDisableAutomaticDeliveryDone = disable;
239}
240
241void ItemSync::setIncrementalSyncItems(const Item::List &changedItems, const Item::List &removedItems)
242{
243 /*
244 * We received an incremental listing of items:
245 * * for each changed item:
246 * ** If locally available => modify
247 * ** else => create
248 * * removed items can be removed right away
249 */
250 Q_D(ItemSync);
251 d->mIncremental = true;
252 if (!d->mStreaming) {
253 d->mDeliveryDone = true;
254 }
255 d->mRemoteItemQueue += changedItems;
256 d->mRemovedRemoteItemQueue += removedItems;
257 d->mTotalItemsProcessed += changedItems.count() + removedItems.count();
258 kDebug() << "Received: " << changedItems.count() << "Removed: " << removedItems.count() << "In total: " << d->mTotalItemsProcessed << " Wanted: " << d->mTotalItems;
259 if (!d->mDisableAutomaticDeliveryDone && (d->mTotalItemsProcessed == d->mTotalItems)) {
260 d->mDeliveryDone = true;
261 }
262 d->execute();
263}
264
265void ItemSync::setFetchScope(ItemFetchScope &fetchScope)
266{
267 Q_D(ItemSync);
268 d->mFetchScope = fetchScope;
269}
270
271ItemFetchScope &ItemSync::fetchScope()
272{
273 Q_D(ItemSync);
274 return d->mFetchScope;
275}
276
277void ItemSync::doStart()
278{
279}
280
281bool ItemSync::updateItem(const Item &storedItem, Item &newItem)
282{
283 Q_UNUSED(storedItem);
284 Q_UNUSED(newItem);
285 return false;
286}
287
288void ItemSyncPrivate::fetchLocalItemsToDelete()
289{
290 Q_Q(ItemSync);
291 if (mIncremental) {
292 kFatal() << "This must not be called while in incremental mode";
293 return;
294 }
295 ItemFetchJob *job = new ItemFetchJob(mSyncCollection, subjobParent());
296 job->fetchScope().setFetchRemoteIdentification(true);
297 job->fetchScope().setFetchModificationTime(false);
298 job->setDeliveryOption(ItemFetchJob::EmitItemsIndividually);
299 // we only can fetch parts already in the cache, otherwise this will deadlock
300 job->fetchScope().setCacheOnly(true);
301
302 QObject::connect(job, SIGNAL(itemsReceived(Akonadi::Item::List)), q, SLOT(slotItemsReceived(Akonadi::Item::List)));
303 QObject::connect(job, SIGNAL(result(KJob*)), q, SLOT(slotLocalListDone(KJob*)));
304 mPendingJobs++;
305}
306
307void ItemSyncPrivate::slotItemsReceived(const Item::List &items)
308{
309 foreach (const Akonadi::Item &item, items) {
310 //Don't delete items that have not yet been synchronized
311 if (item.remoteId().isEmpty()) {
312 continue;
313 }
314 if (!mListedItems.contains(item.remoteId())) {
315 mItemsToDelete << Item(item.id());
316 }
317 }
318}
319
320void ItemSyncPrivate::slotLocalListDone(KJob *job)
321{
322 mPendingJobs--;
323 if (job->error()) {
324 kWarning() << job->errorString();
325 }
326 deleteItems(mItemsToDelete);
327 checkDone();
328}
329
330QString ItemSyncPrivate::jobDebuggingString() const /*Q_DECL_OVERRIDE*/
331{
332 // TODO: also print out mIncremental and mTotalItemsProcessed, but they are set after the job
333 // started, so this requires passing jobDebuggingString to jobEnded().
334 return QString::fromLatin1("Collection %1 (%2)").arg(mSyncCollection.id()).arg(mSyncCollection.name());
335}
336
337void ItemSyncPrivate::execute()
338{
339 Q_Q(ItemSync);
340 //shouldn't happen
341 if (mFinished) {
342 kWarning() << "Call to execute() on finished job.";
343 Q_ASSERT(false);
344 return;
345 }
346 //not doing anything, start processing
347 if (!mProcessingBatch) {
348 if (mRemoteItemQueue.size() >= mBatchSize || mDeliveryDone) {
349 //we have a new batch to process
350 const int num = qMin(mBatchSize, mRemoteItemQueue.size());
351 for (int i = 0; i < num; i++) {
352 mCurrentBatchRemoteItems << mRemoteItemQueue.takeFirst();
353 }
354 mCurrentBatchRemovedRemoteItems += mRemovedRemoteItemQueue;
355 mRemovedRemoteItemQueue.clear();
356 } else {
357 //nothing to do, let's wait for more data
358 return;
359 }
360 mProcessingBatch = true;
361 processBatch();
362 return;
363 }
364 checkDone();
365}
366
367//process the current batch of items
368void ItemSyncPrivate::processBatch()
369{
370 Q_Q(ItemSync);
371 if (mCurrentBatchRemoteItems.isEmpty() && !mDeliveryDone) {
372 return;
373 }
374
375 //request a transaction, there are items that require processing
376 requestTransaction();
377
378 processItems();
379
380 // removed
381 if (!mIncremental && allProcessed()) {
382 //the full listing is done and we know which items to remove
383 fetchLocalItemsToDelete();
384 } else {
385 deleteItems(mCurrentBatchRemovedRemoteItems);
386 mCurrentBatchRemovedRemoteItems.clear();
387 }
388
389 checkDone();
390}
391
392void ItemSyncPrivate::processItems()
393{
394 Q_Q(ItemSync);
395 // added / updated
396 foreach (const Item &remoteItem, mCurrentBatchRemoteItems) {
397 if (remoteItem.remoteId().isEmpty()) {
398 kWarning() << "Item without rid passed to itemsync";
399 continue;
400 }
401 if (!mIncremental) {
402 mListedItems << remoteItem.remoteId();
403 }
404 createOrMerge(remoteItem);
405 }
406 mCurrentBatchRemoteItems.clear();
407}
408
409void ItemSyncPrivate::deleteItems(const Item::List &itemsToDelete)
410{
411 Q_Q(ItemSync);
412 // if in error state, better not change anything anymore
413 if (q->error()) {
414 return;
415 }
416
417 if (itemsToDelete.isEmpty()) {
418 return;
419 }
420
421 mPendingJobs++;
422 ItemDeleteJob *job = new ItemDeleteJob(itemsToDelete, subjobParent());
423 q->connect(job, SIGNAL(result(KJob*)), q, SLOT(slotLocalDeleteDone(KJob*)));
424
425 // It can happen that the groupware servers report us deleted items
426 // twice, in this case this item delete job will fail on the second try.
427 // To avoid a rollback of the complete transaction we gracefully allow the job
428 // to fail :)
429 TransactionSequence *transaction = qobject_cast<TransactionSequence *>(subjobParent());
430 if (transaction) {
431 transaction->setIgnoreJobFailure(job);
432 }
433}
434
435void ItemSyncPrivate::slotLocalDeleteDone(KJob *job)
436{
437 if (job->error()) {
438 kWarning() << "Deleting items from the akonadi database failed:" << job->errorString();
439 }
440 mPendingJobs--;
441 mProgress++;
442
443 checkDone();
444}
445
446void ItemSyncPrivate::slotLocalChangeDone(KJob *job)
447{
448 if (job->error()) {
449 kWarning() << "Creating/updating items from the akonadi database failed:" << job->errorString();
450 }
451 mPendingJobs--;
452 mProgress++;
453
454 checkDone();
455}
456
457void ItemSyncPrivate::slotTransactionResult(KJob *job)
458{
459 --mTransactionJobs;
460 if (mCurrentTransaction == job) {
461 mCurrentTransaction = 0;
462 }
463
464 checkDone();
465}
466
467void ItemSyncPrivate::requestTransaction()
468{
469 Q_Q(ItemSync);
470 //we never want parallel transactions, single transaction just makes one big transaction, and multi transaction uses multiple transaction sequentially
471 if (!mCurrentTransaction) {
472 ++mTransactionJobs;
473 mCurrentTransaction = new TransactionSequence(q);
474 mCurrentTransaction->setAutomaticCommittingEnabled(false);
475 QObject::connect(mCurrentTransaction, SIGNAL(result(KJob*)), q, SLOT(slotTransactionResult(KJob*)));
476 }
477}
478
479Job *ItemSyncPrivate::subjobParent() const
480{
481 Q_Q(const ItemSync);
482 if (mCurrentTransaction && mTransactionMode != ItemSync::NoTransaction) {
483 return mCurrentTransaction;
484 }
485 return const_cast<ItemSync *>(q);
486}
487
488void ItemSync::setStreamingEnabled(bool enable)
489{
490 Q_D(ItemSync);
491 d->mStreaming = enable;
492}
493
494void ItemSync::deliveryDone()
495{
496 Q_D(ItemSync);
497 Q_ASSERT(d->mStreaming);
498 d->mDeliveryDone = true;
499 d->execute();
500}
501
502void ItemSync::slotResult(KJob *job)
503{
504 if (job->error()) {
505 // pretent there were no errors
506 Akonadi::Job::removeSubjob(job);
507 // propagate the first error we got but continue, we might still be fed with stuff from a resource
508 if (!error()) {
509 setError(job->error());
510 setErrorText(job->errorText());
511 }
512 } else {
513 Akonadi::Job::slotResult(job);
514 }
515}
516
517void ItemSync::rollback()
518{
519 Q_D(ItemSync);
520 setError(UserCanceled);
521 if (d->mCurrentTransaction) {
522 d->mCurrentTransaction->rollback();
523 }
524 d->mDeliveryDone = true; // user wont deliver more data
525 d->execute(); // end this in an ordered way, since we have an error set no real change will be done
526}
527
528void ItemSync::setTransactionMode(ItemSync::TransactionMode mode)
529{
530 Q_D(ItemSync);
531 d->mTransactionMode = mode;
532}
533
534int ItemSync::batchSize() const
535{
536 Q_D(const ItemSync);
537 return d->mBatchSize;
538}
539
540void ItemSync::setBatchSize(int size)
541{
542 Q_D(ItemSync);
543 d->mBatchSize = size;
544}
545
546ItemSync::MergeMode ItemSync::mergeMode() const
547{
548 Q_D(const ItemSync);
549 return d->mMergeMode;
550}
551
552void ItemSync::setMergeMode(MergeMode mergeMode)
553{
554 Q_D(ItemSync);
555 d->mMergeMode = mergeMode;
556}
557
558#include "moc_itemsync.cpp"
Akonadi::Collection
Represents a collection of PIM items.
Definition collection.h:76
Akonadi::ItemCreateJob
Job that creates a new item in the Akonadi storage.
Definition itemcreatejob.h:74
Akonadi::ItemCreateJob::Silent
@ Silent
Only return the id of the merged/created item.
Definition itemcreatejob.h:102
Akonadi::ItemCreateJob::RID
@ RID
Merge by remote id.
Definition itemcreatejob.h:100
Akonadi::ItemCreateJob::GID
@ GID
Merge by GID.
Definition itemcreatejob.h:101
Akonadi::ItemCreateJob::setMerge
void setMerge(MergeOptions options)
Merge this item into an existing one if available.
Definition itemcreatejob.cpp:248
Akonadi::ItemDeleteJob
Job that deletes items from the Akonadi storage.
Definition itemdeletejob.h:63
Akonadi::ItemFetchJob
Job that fetches items from the Akonadi storage.
Definition itemfetchjob.h:83
Akonadi::ItemFetchJob::setDeliveryOption
void setDeliveryOption(DeliveryOptions options)
Sets the mechanisms by which the items should be fetched.
Definition itemfetchjob.cpp:275
Akonadi::ItemFetchJob::EmitItemsIndividually
@ EmitItemsIndividually
emitted via signal upon reception
Definition itemfetchjob.h:224
Akonadi::ItemFetchJob::fetchScope
ItemFetchScope & fetchScope()
Returns the item fetch scope.
Definition itemfetchjob.cpp:261
Akonadi::ItemFetchScope
Specifies which parts of an item should be fetched from the Akonadi storage.
Definition itemfetchscope.h:70
Akonadi::ItemFetchScope::setFetchRemoteIdentification
void setFetchRemoteIdentification(bool retrieveRid)
Fetch remote identification for items.
Definition itemfetchscope.cpp:177
Akonadi::ItemFetchScope::setCacheOnly
void setCacheOnly(bool cacheOnly)
Sets whether payload data should be requested from remote sources or just from the local cache.
Definition itemfetchscope.cpp:109
Akonadi::ItemFetchScope::fetchAllAttributes
void fetchAllAttributes(bool fetch=true)
Sets whether all available attributes should be fetched.
Definition itemfetchscope.cpp:94
Akonadi::ItemFetchScope::setFetchModificationTime
void setFetchModificationTime(bool retrieveMtime)
Enables retrieval of the item modification time.
Definition itemfetchscope.cpp:137
Akonadi::ItemFetchScope::fetchFullPayload
void fetchFullPayload(bool fetch=true)
Sets whether the full payload shall be fetched.
Definition itemfetchscope.cpp:70
Akonadi::ItemSync
Syncs between items known to a client (usually a resource) and the Akonadi storage.
Definition itemsync.h:55
Akonadi::ItemSync::setTotalItems
void setTotalItems(int amount)
Set the amount of items which you are going to return in total by using the setFullSyncItems()/setInc...
Definition itemsync.cpp:220
Akonadi::ItemSync::updateItem
virtual AKONADI_DEPRECATED bool updateItem(const Item &storedItem, Item &newItem)
Reimplement this method to customize the synchronization algorithm.
Definition itemsync.cpp:281
Akonadi::ItemSync::TransactionMode
TransactionMode
Transaction mode used by ItemSync.
Definition itemsync.h:170
Akonadi::ItemSync::NoTransaction
@ NoTransaction
Use no transaction at all, provides highest responsiveness (might therefore feel faster even when act...
Definition itemsync.h:173
Akonadi::ItemSync::MultipleTransactions
@ MultipleTransactions
Use one transaction per chunk of delivered items, good compromise between the other two when using st...
Definition itemsync.h:172
Akonadi::ItemSync::setDisableAutomaticDeliveryDone
void setDisableAutomaticDeliveryDone(bool disable)
Disables the automatic completion of the item sync, based on the number of delivered items.
Definition itemsync.cpp:235
Akonadi::ItemSync::setIncrementalSyncItems
void setIncrementalSyncItems(const Item::List &changedItems, const Item::List &removedItems)
Sets the item lists for incrementally syncing the collection.
Definition itemsync.cpp:241
Akonadi::ItemSync::fetchScope
ItemFetchScope & fetchScope()
Returns the item fetch scope.
Definition itemsync.cpp:271
Akonadi::ItemSync::mergeMode
MergeMode mergeMode() const
Returns current merge mode.
Definition itemsync.cpp:546
Akonadi::ItemSync::setBatchSize
void setBatchSize(int)
Set the batch size.
Definition itemsync.cpp:540
Akonadi::ItemSync::setFullSyncItems
void setFullSyncItems(const Item::List &items)
Sets the full item list for the collection.
Definition itemsync.cpp:196
Akonadi::ItemSync::ItemSync
ItemSync(const Collection &collection, QObject *parent=0)
Creates a new item synchronizer.
Definition itemsync.cpp:185
Akonadi::ItemSync::rollback
void rollback()
Aborts the sync process and rolls back all not yet committed transactions.
Definition itemsync.cpp:517
Akonadi::ItemSync::deliveryDone
void deliveryDone()
Notify ItemSync that all remote items have been delivered.
Definition itemsync.cpp:494
Akonadi::ItemSync::batchSize
int batchSize() const
Minimum number of items required to start processing in streaming mode.
Definition itemsync.cpp:534
Akonadi::ItemSync::setFetchScope
void setFetchScope(ItemFetchScope &fetchScope)
Sets the item fetch scope.
Definition itemsync.cpp:265
Akonadi::ItemSync::setStreamingEnabled
void setStreamingEnabled(bool enable)
Enable item streaming.
Definition itemsync.cpp:488
Akonadi::ItemSync::doStart
void doStart()
This method must be reimplemented in the concrete jobs.
Definition itemsync.cpp:277
Akonadi::ItemSync::setMergeMode
void setMergeMode(MergeMode mergeMode)
Set what merge method should be used for next ItemSync run.
Definition itemsync.cpp:552
Akonadi::ItemSync::~ItemSync
~ItemSync()
Destroys the item synchronizer.
Definition itemsync.cpp:192
Akonadi::ItemSync::setTransactionMode
void setTransactionMode(TransactionMode mode)
Set the transaction mode to use for this sync.
Definition itemsync.cpp:528
Akonadi::JobPrivate
Definition job_p.h:32
Akonadi::Job
Base class for all actions in the Akonadi storage.
Definition job.h:87
Akonadi::Job::UserCanceled
@ UserCanceled
The user canceld this job.
Definition job.h:107
Akonadi::Job::removeSubjob
virtual bool removeSubjob(KJob *job)
Removes the given subjob of this job.
Definition job.cpp:338
Akonadi::TransactionSequence
Base class for jobs that need to run a sequence of sub-jobs in a transaction.
Definition transactionsequence.h:70
Akonadi::TransactionSequence::commit
void commit()
Commits the transaction as soon as all pending sub-jobs finished successfully.
Definition transactionsequence.cpp:154
Akonadi::TransactionSequence::setIgnoreJobFailure
void setIgnoreJobFailure(KJob *job)
Sets which job of the sequence might fail without rolling back the complete transaction.
Definition transactionsequence.cpp:186
Akonadi::TransactionSequence::setAutomaticCommittingEnabled
void setAutomaticCommittingEnabled(bool enable)
Disable automatic committing.
Definition transactionsequence.cpp:209
Akonadi
FreeBusyManager::Singleton.
Definition actionstatemanager_p.h:28
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Wed Jan 24 2024 00:00:00 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akonadi

Skip menu "akonadi"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs-4.14.10 API Reference

Skip menu "kdepimlibs-4.14.10 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal