-rw-r--r-- | korganizer/calendarview.cpp | 70 |
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 | |||
@@ -925,4 +925,6 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int | |||
925 | int changedLocal = 0; | 925 | int changedLocal = 0; |
926 | int changedRemote = 0; | 926 | int changedRemote = 0; |
927 | int filteredIN = 0; | ||
928 | int filteredOUT = 0; | ||
927 | //QPtrList<Event> el = local->rawEvents(); | 929 | //QPtrList<Event> el = local->rawEvents(); |
928 | Event* eventR; | 930 | Event* eventR; |
@@ -1102,4 +1104,6 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int | |||
1102 | } | 1104 | } |
1103 | } | 1105 | } |
1106 | } else { | ||
1107 | ++filteredIN; | ||
1104 | } | 1108 | } |
1105 | } | 1109 | } |
@@ -1129,41 +1133,43 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int | |||
1129 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->type() == "Journal" ) | 1133 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->type() == "Journal" ) |
1130 | skipIncidence = true; | 1134 | skipIncidence = true; |
1131 | if ( filterOUT && ! filterOUT->filterCalendarItem( inL ) ){ | ||
1132 | skipIncidence = true; | ||
1133 | } | ||
1134 | if ( !skipIncidence ) { | 1135 | if ( !skipIncidence ) { |
1135 | inR = remote->incidence( uid ); | 1136 | inR = remote->incidence( uid ); |
1136 | if ( ! inR ) { // no conflict ********** add or delete local | 1137 | if ( ! inR ) { |
1137 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 1138 | if ( !filterOUT || filterOUT->filterCalendarItem( inL ) ){ |
1138 | if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { | 1139 | // no conflict ********** add or delete local |
1139 | checkExternSyncEvent(eventLSyncSharp, inL); | 1140 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
1140 | local->deleteIncidence( inL ); | 1141 | if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { |
1141 | ++deletedEventL; | 1142 | checkExternSyncEvent(eventLSyncSharp, inL); |
1142 | } else { | 1143 | local->deleteIncidence( inL ); |
1143 | if ( ! mSyncManager->mWriteBackExistingOnly ) { | 1144 | ++deletedEventL; |
1144 | inL->removeID(mCurrentSyncDevice ); | 1145 | } else { |
1145 | ++addedEventR; | 1146 | if ( ! mSyncManager->mWriteBackExistingOnly ) { |
1146 | //qDebug("remote added Incidence %s ", inL->summary().latin1()); | 1147 | inL->removeID(mCurrentSyncDevice ); |
1147 | inL->setLastModified( modifiedCalendar ); | 1148 | ++addedEventR; |
1148 | inR = inL->clone(); | 1149 | //qDebug("remote added Incidence %s ", inL->summary().latin1()); |
1149 | inR->setIDStr( ":" ); | 1150 | inL->setLastModified( modifiedCalendar ); |
1150 | inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); | 1151 | inR = inL->clone(); |
1151 | remote->addIncidence( inR ); | 1152 | inR->setIDStr( ":" ); |
1153 | inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); | ||
1154 | remote->addIncidence( inR ); | ||
1155 | } | ||
1152 | } | 1156 | } |
1153 | } | ||
1154 | } else { | ||
1155 | if ( inL->lastModified() < mLastCalendarSync && mode != 4 ) { | ||
1156 | checkExternSyncEvent(eventLSyncSharp, inL); | ||
1157 | local->deleteIncidence( inL ); | ||
1158 | ++deletedEventL; | ||
1159 | } else { | 1157 | } else { |
1160 | if ( ! mSyncManager->mWriteBackExistingOnly ) { | 1158 | if ( inL->lastModified() < mLastCalendarSync && mode != 4 ) { |
1161 | ++addedEventR; | 1159 | checkExternSyncEvent(eventLSyncSharp, inL); |
1162 | inL->setLastModified( modifiedCalendar ); | 1160 | local->deleteIncidence( inL ); |
1163 | inR = inL->clone(); | 1161 | ++deletedEventL; |
1164 | inR->setIDStr( ":" ); | 1162 | } else { |
1165 | remote->addIncidence( inR ); | 1163 | if ( ! mSyncManager->mWriteBackExistingOnly ) { |
1164 | ++addedEventR; | ||
1165 | inL->setLastModified( modifiedCalendar ); | ||
1166 | inR = inL->clone(); | ||
1167 | inR->setIDStr( ":" ); | ||
1168 | remote->addIncidence( inR ); | ||
1169 | } | ||
1166 | } | 1170 | } |
1167 | } | 1171 | } |
1172 | } else { | ||
1173 | ++filteredOUT; | ||
1168 | } | 1174 | } |
1169 | } | 1175 | } |
@@ -1219,5 +1225,5 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int | |||
1219 | delete eventRSync; | 1225 | delete eventRSync; |
1220 | QString mes; | 1226 | QString mes; |
1221 | 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 ); | 1227 | 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 ); |
1222 | QString delmess; | 1228 | QString delmess; |
1223 | if ( delFut ) { | 1229 | if ( delFut ) { |