-rw-r--r-- | korganizer/calendarview.cpp | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index a350c3b..7044e90 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -1438,13 +1438,13 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int | |||
1438 | bool skipIncidence = false; | 1438 | bool skipIncidence = false; |
1439 | if ( uid.left(15) == QString("last-syncEvent-") ) | 1439 | if ( uid.left(15) == QString("last-syncEvent-") ) |
1440 | skipIncidence = true; | 1440 | skipIncidence = true; |
1441 | QString idS; | 1441 | QString idS; |
1442 | qApp->processEvents(); | 1442 | qApp->processEvents(); |
1443 | if ( !skipIncidence ) { | 1443 | if ( !skipIncidence ) { |
1444 | inL = local->incidence( uid ); | 1444 | inL = local->incidenceForUid( uid , false ); |
1445 | if ( inL ) { // maybe conflict - same uid in both calendars | 1445 | if ( inL ) { // maybe conflict - same uid in both calendars |
1446 | if ( (take = takeEvent( inL, inR, mode, fullDateRange )) > 0 ) { | 1446 | if ( (take = takeEvent( inL, inR, mode, fullDateRange )) > 0 ) { |
1447 | //qDebug("take %d %s ", take, inL->summary().latin1()); | 1447 | //qDebug("take %d %s ", take, inL->summary().latin1()); |
1448 | if ( take == 3 ) | 1448 | if ( take == 3 ) |
1449 | return false; | 1449 | return false; |
1450 | if ( take == 1 ) {// take local ********************** | 1450 | if ( take == 1 ) {// take local ********************** |
@@ -1461,27 +1461,29 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int | |||
1461 | inR->setIDStr( idS ); | 1461 | inR->setIDStr( idS ); |
1462 | remote->addIncidence( inR ); | 1462 | remote->addIncidence( inR ); |
1463 | if ( mSyncManager->syncWithDesktop() ) | 1463 | if ( mSyncManager->syncWithDesktop() ) |
1464 | inR->setPilotId( 2 ); | 1464 | inR->setPilotId( 2 ); |
1465 | ++changedRemote; | 1465 | ++changedRemote; |
1466 | } else {// take remote ********************** | 1466 | } else {// take remote ********************** |
1467 | idS = inL->IDStr(); | 1467 | if ( !inL->isReadOnly() ) { |
1468 | int pid = inL->pilotId(); | 1468 | idS = inL->IDStr(); |
1469 | int calID = inL->calID(); | 1469 | int pid = inL->pilotId(); |
1470 | local->deleteIncidence( inL ); | 1470 | int calID = inL->calID(); |
1471 | inL = inR->clone(); | 1471 | local->deleteIncidence( inL ); |
1472 | inL->setCalID( calID ); | 1472 | inL = inR->clone(); |
1473 | if ( mSyncManager->syncWithDesktop() ) | 1473 | inL->setCalID( calID ); |
1474 | inL->setPilotId( pid ); | 1474 | if ( mSyncManager->syncWithDesktop() ) |
1475 | inL->setIDStr( idS ); | 1475 | inL->setPilotId( pid ); |
1476 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 1476 | inL->setIDStr( idS ); |
1477 | inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); | 1477 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
1478 | inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) ); | 1478 | inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); |
1479 | inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) ); | ||
1480 | } | ||
1481 | local->addIncidence( inL ); | ||
1482 | ++changedLocal; | ||
1479 | } | 1483 | } |
1480 | local->addIncidence( inL ); | ||
1481 | ++changedLocal; | ||
1482 | } | 1484 | } |
1483 | } | 1485 | } |
1484 | } else { // no conflict ********** add or delete remote | 1486 | } else { // no conflict ********** add or delete remote |
1485 | if ( !filterIN || filterIN->filterCalendarItem( inR ) ){ | 1487 | if ( !filterIN || filterIN->filterCalendarItem( inR ) ){ |
1486 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 1488 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
1487 | QString des = eventLSync->description(); | 1489 | QString des = eventLSync->description(); |
@@ -1546,13 +1548,13 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int | |||
1546 | bool skipIncidence = false; | 1548 | bool skipIncidence = false; |
1547 | if ( uid.left(15) == QString("last-syncEvent-") ) | 1549 | if ( uid.left(15) == QString("last-syncEvent-") ) |
1548 | skipIncidence = true; | 1550 | skipIncidence = true; |
1549 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->typeID() == journalID ) | 1551 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->typeID() == journalID ) |
1550 | skipIncidence = true; | 1552 | skipIncidence = true; |
1551 | if ( !skipIncidence ) { | 1553 | if ( !skipIncidence ) { |
1552 | inR = remote->incidence( uid ); | 1554 | inR = remote->incidenceForUid( uid , true ); |
1553 | if ( ! inR ) { | 1555 | if ( ! inR ) { |
1554 | if ( !filterOUT || filterOUT->filterCalendarItem( inL ) ){ | 1556 | if ( !filterOUT || filterOUT->filterCalendarItem( inL ) ){ |
1555 | // no conflict ********** add or delete local | 1557 | // no conflict ********** add or delete local |
1556 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 1558 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
1557 | if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { | 1559 | if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { |
1558 | checkExternSyncEvent(eventLSyncSharp, inL); | 1560 | checkExternSyncEvent(eventLSyncSharp, inL); |