From 5b434dd78f71bcea5e6067fc8ae0faaaea313f9d Mon Sep 17 00:00:00 2001 From: zautrix Date: Sun, 12 Sep 2004 19:26:13 +0000 Subject: phone fixes --- (limited to 'korganizer/calendarview.cpp') diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index cfd9290..d5d31e2 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -1124,6 +1124,7 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int } inL = el.next(); } + int delFut = 0; if ( KOPrefs::instance()->mWriteBackInFuture ) { er = remote->rawIncidences(); inR = er.first(); @@ -1138,9 +1139,18 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int else dt = cur.addSecs( 62 ); } - else dt = inR->dtStart(); - if ( dt < cur || dt > end ) + 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(); } } @@ -1158,6 +1168,11 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int remote->addEvent( 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 ); + QString delmess; + if ( delFut ) { + delmess.sprintf( i18n("%d items skipped on remote,\nbecause they are in the past or\nmore than %d weeks in the future.\n"),delFut, KOPrefs::instance()->mWriteBackInFuture ); + mes += delmess; + } if ( KOPrefs::instance()->mShowSyncSummary ) { KMessageBox::information(this, mes, i18n("KO/Pi Synchronization") ); } @@ -1245,12 +1260,10 @@ void CalendarView::syncExternal( int mode ) { QPtrList iL = mCalendar->rawIncidences(); Incidence* inc = iL.first(); - /* obsolete while ( inc ) { - inc->setZaurusStat( inc->revision () ); + inc->removeID(mCurrentSyncDevice); inc = iL.next(); } - */ #ifndef DESKTOP_VERSION if ( sharpFormat ) sharpFormat->save(calendar); -- cgit v0.9.0.2