akonadi
21 #include "conflicthandler_p.h"
23 #include "conflictresolvedialog_p.h"
25 #include <akonadi/itemcreatejob.h>
26 #include <akonadi/itemfetchjob.h>
27 #include <akonadi/itemfetchscope.h>
28 #include <akonadi/itemmodifyjob.h>
29 #include <akonadi/session.h>
32 using namespace Akonadi;
36 mConflictType( type ),
37 mSession( new
Session(
"conflict handling session", this ) )
43 mChangedItem = changedItem;
44 mConflictingItem = conflictingItem;
53 connect( job, SIGNAL(result(KJob*)), SLOT(slotOtherItemFetched(KJob*)) );
59 void ConflictHandler::slotOtherItemFetched( KJob *job )
62 emit
error( job->errorText() );
67 if ( fetchJob->
items().isEmpty() ) {
68 emit
error( i18n(
"Did not find other item for conflict handling" ) );
72 mConflictingItem = fetchJob->
items().first();
73 QMetaObject::invokeMethod(
this,
"resolve", Qt::QueuedConnection );
76 void ConflictHandler::resolve()
96 void ConflictHandler::useLocalItem()
102 Item newItem( mChangedItem );
103 newItem.setRevision( mConflictingItem.
revision() );
106 connect( job, SIGNAL(result(KJob*)), SLOT(slotUseLocalItemFinished(KJob*)) );
109 void ConflictHandler::slotUseLocalItemFinished( KJob *job )
111 if ( job->error() ) {
112 emit
error( job->errorText() );
118 void ConflictHandler::useOtherItem()
124 void ConflictHandler::useBothItems()
129 connect( job, SIGNAL(result(KJob*)), SLOT(slotUseBothItemsFinished(KJob*)) );
132 void ConflictHandler::slotUseBothItemsFinished( KJob *job )
134 if ( job->error() ) {
135 emit
error( job->errorText() );
141 #include "moc_conflicthandler_p.cpp"
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:27:34 by
doxygen 1.8.3.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.