-rw-r--r-- | korganizer/calendarview.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 7fae4a9..bc8625d 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -1130,50 +1130,50 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int | |||
1130 | } | 1130 | } |
1131 | } | 1131 | } |
1132 | } else { | 1132 | } else { |
1133 | if ( inL->lastModified() < mLastCalendarSync && mode != 4 ) { | 1133 | if ( inL->lastModified() < mLastCalendarSync && mode != 4 ) { |
1134 | checkExternSyncEvent(eventLSyncSharp, inL); | 1134 | checkExternSyncEvent(eventLSyncSharp, inL); |
1135 | local->deleteIncidence( inL ); | 1135 | local->deleteIncidence( inL ); |
1136 | ++deletedEventL; | 1136 | ++deletedEventL; |
1137 | } else { | 1137 | } else { |
1138 | if ( ! KOPrefs::instance()->mWriteBackExistingOnly ) { | 1138 | if ( ! KOPrefs::instance()->mWriteBackExistingOnly ) { |
1139 | ++addedEventR; | 1139 | ++addedEventR; |
1140 | inL->setLastModified( modifiedCalendar ); | 1140 | inL->setLastModified( modifiedCalendar ); |
1141 | remote->addIncidence( inL->clone() ); | 1141 | remote->addIncidence( inL->clone() ); |
1142 | } | 1142 | } |
1143 | } | 1143 | } |
1144 | } | 1144 | } |
1145 | } | 1145 | } |
1146 | } | 1146 | } |
1147 | inL = el.next(); | 1147 | inL = el.next(); |
1148 | } | 1148 | } |
1149 | int delFut = 0; | 1149 | int delFut = 0; |
1150 | if ( KOPrefs::instance()->mWriteBackInFuture ) { | 1150 | if ( KOPrefs::instance()->mWriteBackInFuture ) { |
1151 | er = remote->rawIncidences(); | 1151 | er = remote->rawIncidences(); |
1152 | inR = er.first(); | 1152 | inR = er.first(); |
1153 | QDateTime dt; | 1153 | QDateTime dt; |
1154 | QDateTime cur = QDateTime::currentDateTime(); | 1154 | QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); |
1155 | QDateTime end = cur.addSecs( KOPrefs::instance()->mWriteBackInFuture * 3600 *24 *7 ); | 1155 | QDateTime end = cur.addDays( (KOPrefs::instance()->mWriteBackInFuture +1 ) *7 ); |
1156 | while ( inR ) { | 1156 | while ( inR ) { |
1157 | if ( inR->type() == "Todo" ) { | 1157 | if ( inR->type() == "Todo" ) { |
1158 | Todo * t = (Todo*)inR; | 1158 | Todo * t = (Todo*)inR; |
1159 | if ( t->hasDueDate() ) | 1159 | if ( t->hasDueDate() ) |
1160 | dt = t->dtDue(); | 1160 | dt = t->dtDue(); |
1161 | else | 1161 | else |
1162 | dt = cur.addSecs( 62 ); | 1162 | dt = cur.addSecs( 62 ); |
1163 | } | 1163 | } |
1164 | else if (inR->type() == "Event" ) { | 1164 | else if (inR->type() == "Event" ) { |
1165 | bool ok; | 1165 | bool ok; |
1166 | dt = inR->getNextOccurence( cur, &ok ); | 1166 | dt = inR->getNextOccurence( cur, &ok ); |
1167 | if ( !ok ) | 1167 | if ( !ok ) |
1168 | dt = cur.addSecs( -62 ); | 1168 | dt = cur.addSecs( -62 ); |
1169 | } | 1169 | } |
1170 | else | 1170 | else |
1171 | dt = inR->dtStart(); | 1171 | dt = inR->dtStart(); |
1172 | if ( dt < cur || dt > end ) { | 1172 | if ( dt < cur || dt > end ) { |
1173 | remote->deleteIncidence( inR ); | 1173 | remote->deleteIncidence( inR ); |
1174 | ++delFut; | 1174 | ++delFut; |
1175 | } | 1175 | } |
1176 | inR = er.next(); | 1176 | inR = er.next(); |
1177 | } | 1177 | } |
1178 | } | 1178 | } |
1179 | bar.hide(); | 1179 | bar.hide(); |