summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/calendarview.cpp13
-rw-r--r--libkcal/event.cpp1
2 files changed, 11 insertions, 3 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 94cc97d..ce41fbd 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1010,38 +1010,46 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
bar.setProgress( incCounter );
++incCounter;
uid = inR->uid();
bool skipIncidence = false;
if ( uid.left(15) == QString("last-syncEvent-") )
skipIncidence = true;
-
+ QString idS;
qApp->processEvents();
if ( !skipIncidence ) {
inL = local->incidence( uid );
if ( inL ) { // maybe conflict - same uid in both calendars
int maxrev = inL->revision();
if ( maxrev < inR->revision() )
maxrev = inR->revision();
if ( (take = takeEvent( inL, inR, mode, fullDateRange )) > 0 ) {
//qDebug("take %d %s ", take, inL->summary().latin1());
if ( take == 3 )
return false;
if ( take == 1 ) {// take local
+ if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL )
inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) );
+ else
+ idS = inR->IDStr();
remote->deleteIncidence( inR );
if ( inL->revision() < maxrev )
inL->setRevision( maxrev );
inR = inL->clone();
inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
+ if ( mGlobalSyncMode != SYNC_MODE_EXTERNAL )
+ inR->setIDStr( idS );
remote->addIncidence( inR );
++changedRemote;
} else {
if ( inR->revision() < maxrev )
inR->setRevision( maxrev );
+ idS = inL->IDStr();
local->deleteIncidence( inL );
- local->addIncidence( inR->clone() );
+ inL = inR->clone();
+ inL->setIDStr( idS );
+ local->addIncidence( inL );
++changedLocal;
}
}
} else { // no conflict
if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
QString des = eventLSync->description();
@@ -1097,12 +1105,13 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
skipIncidence = true;
if ( !skipIncidence ) {
inR = remote->incidence( uid );
if ( ! inR ) {
if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) {
+ checkExternSyncEvent(eventLSyncSharp, inL);
local->deleteIncidence( inL );
++deletedEventL;
} else {
if ( ! KOPrefs::instance()->mWriteBackExistingOnly ) {
inL->removeID(mCurrentSyncDevice );
++addedEventR;
diff --git a/libkcal/event.cpp b/libkcal/event.cpp
index dd67252..dfa265b 100644
--- a/libkcal/event.cpp
+++ b/libkcal/event.cpp
@@ -41,13 +41,12 @@ Event::Event(const Event &e) : Incidence(e)
Event::~Event()
{
}
Incidence *Event::clone()
{
- kdDebug(5800) << "Event::clone()" << endl;
return new Event(*this);
}
bool KCal::operator==( const Event& e1, const Event& e2 )
{
return operator==( (const Incidence&)e1, (const Incidence&)e2 ) &&