summaryrefslogtreecommitdiffabout
path: root/korganizer/calendarview.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/calendarview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/calendarview.cpp4
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
}
}
} else {
if ( inL->lastModified() < mLastCalendarSync && mode != 4 ) {
checkExternSyncEvent(eventLSyncSharp, inL);
local->deleteIncidence( inL );
++deletedEventL;
} else {
if ( ! KOPrefs::instance()->mWriteBackExistingOnly ) {
++addedEventR;
inL->setLastModified( modifiedCalendar );
remote->addIncidence( inL->clone() );
}
}
}
}
}
inL = el.next();
}
int delFut = 0;
if ( KOPrefs::instance()->mWriteBackInFuture ) {
er = remote->rawIncidences();
inR = er.first();
QDateTime dt;
- QDateTime cur = QDateTime::currentDateTime();
- QDateTime end = cur.addSecs( KOPrefs::instance()->mWriteBackInFuture * 3600 *24 *7 );
+ QDateTime cur = QDateTime::currentDateTime().addDays( -7 );
+ QDateTime end = cur.addDays( (KOPrefs::instance()->mWriteBackInFuture +1 ) *7 );
while ( inR ) {
if ( inR->type() == "Todo" ) {
Todo * t = (Todo*)inR;
if ( t->hasDueDate() )
dt = t->dtDue();
else
dt = cur.addSecs( 62 );
}
else if (inR->type() == "Event" ) {
bool ok;
dt = inR->getNextOccurence( cur, &ok );
if ( !ok )
dt = cur.addSecs( -62 );
}
else
dt = inR->dtStart();
if ( dt < cur || dt > end ) {
remote->deleteIncidence( inR );
++delFut;
}
inR = er.next();
}
}
bar.hide();