summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp70
1 files changed, 38 insertions, 32 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 685bb60..da1edea 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -923,8 +923,10 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
int deletedEventR = 0;
int deletedEventL = 0;
int changedLocal = 0;
int changedRemote = 0;
+ int filteredIN = 0;
+ int filteredOUT = 0;
//QPtrList<Event> el = local->rawEvents();
Event* eventR;
QString uid;
int take;
@@ -1100,8 +1102,10 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
remote->deleteIncidence( inR );
++deletedEventR;
}
}
+ } else {
+ ++filteredIN;
}
}
}
inR = er.next();
@@ -1127,45 +1131,47 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
if ( uid.left(15) == QString("last-syncEvent-") )
skipIncidence = true;
if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->type() == "Journal" )
skipIncidence = true;
- if ( filterOUT && ! filterOUT->filterCalendarItem( inL ) ){
- skipIncidence = true;
- }
if ( !skipIncidence ) {
inR = remote->incidence( uid );
- if ( ! inR ) { // no conflict ********** add or delete local
- if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
- if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) {
- checkExternSyncEvent(eventLSyncSharp, inL);
- local->deleteIncidence( inL );
- ++deletedEventL;
- } else {
- if ( ! mSyncManager->mWriteBackExistingOnly ) {
- inL->removeID(mCurrentSyncDevice );
- ++addedEventR;
- //qDebug("remote added Incidence %s ", inL->summary().latin1());
- inL->setLastModified( modifiedCalendar );
- inR = inL->clone();
- inR->setIDStr( ":" );
- inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
- remote->addIncidence( inR );
+ if ( ! inR ) {
+ if ( !filterOUT || filterOUT->filterCalendarItem( inL ) ){
+ // no conflict ********** add or delete local
+ if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
+ if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) {
+ checkExternSyncEvent(eventLSyncSharp, inL);
+ local->deleteIncidence( inL );
+ ++deletedEventL;
+ } else {
+ if ( ! mSyncManager->mWriteBackExistingOnly ) {
+ inL->removeID(mCurrentSyncDevice );
+ ++addedEventR;
+ //qDebug("remote added Incidence %s ", inL->summary().latin1());
+ inL->setLastModified( modifiedCalendar );
+ inR = inL->clone();
+ inR->setIDStr( ":" );
+ inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
+ remote->addIncidence( inR );
+ }
}
- }
- } else {
- if ( inL->lastModified() < mLastCalendarSync && mode != 4 ) {
- checkExternSyncEvent(eventLSyncSharp, inL);
- local->deleteIncidence( inL );
- ++deletedEventL;
} else {
- if ( ! mSyncManager->mWriteBackExistingOnly ) {
- ++addedEventR;
- inL->setLastModified( modifiedCalendar );
- inR = inL->clone();
- inR->setIDStr( ":" );
- remote->addIncidence( inR );
+ if ( inL->lastModified() < mLastCalendarSync && mode != 4 ) {
+ checkExternSyncEvent(eventLSyncSharp, inL);
+ local->deleteIncidence( inL );
+ ++deletedEventL;
+ } else {
+ if ( ! mSyncManager->mWriteBackExistingOnly ) {
+ ++addedEventR;
+ inL->setLastModified( modifiedCalendar );
+ inR = inL->clone();
+ inR->setIDStr( ":" );
+ remote->addIncidence( inR );
+ }
}
}
+ } else {
+ ++filteredOUT;
}
}
}
inL = el.next();
@@ -1217,9 +1223,9 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
remote->addEvent( eventRSync );
else
delete eventRSync;
QString mes;
- mes .sprintf( i18n("Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n"),addedEvent, addedEventR, changedLocal, changedRemote, deletedEventL, deletedEventR );
+ mes .sprintf( i18n("Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n %d incoming filtered out\n %d outgoing filtered out\n"),addedEvent, addedEventR, changedLocal, changedRemote, deletedEventL, deletedEventR, filteredIN, filteredOUT );
QString delmess;
if ( delFut ) {
delmess.sprintf( i18n("%d items skipped on remote,\nbecause they are more\nthan %d weeks in the past or\nmore than %d weeks in the future.\nAfter skipping, remote has\n%d calendar/todo items."), delFut,mSyncManager->mWriteBackInPast,mSyncManager->mWriteBackInFuture, remRem-delFut);
mes += delmess;