author | zautrix <zautrix> | 2004-10-17 19:15:12 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-17 19:15:12 (UTC) |
commit | a20e8333d7178a01672545232b74bd5cb6d6958b (patch) (side-by-side diff) | |
tree | c21854e85a9d5da5e91abba6705de8b3929ad97f | |
parent | 6f6d1d58938539215bb4fcb5b97cf9fb089a11ef (diff) | |
download | kdepimpi-a20e8333d7178a01672545232b74bd5cb6d6958b.zip kdepimpi-a20e8333d7178a01672545232b74bd5cb6d6958b.tar.gz kdepimpi-a20e8333d7178a01672545232b74bd5cb6d6958b.tar.bz2 |
kde sync fixes
-rw-r--r-- | korganizer/calendarview.cpp | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index ff1db2c..290c0b9 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -711,18 +711,12 @@ void CalendarView::createPrinter() // 4 syncPrefsGroup->addRadio(i18n("Force take local entry always")); // 5 syncPrefsGroup->addRadio(i18n("Force take remote entry always")); int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , bool full ) { - //void setZaurusId(int id); - // int zaurusId() const; - // void setZaurusUid(int id); - // int zaurusUid() const; - // void setZaurusStat(int id); - // int zaurusStat() const; // 0 equal // 1 take local // 2 take remote // 3 cancel QDateTime lastSync = mLastCalendarSync; QDateTime localMod = local->lastModified(); @@ -940,13 +934,13 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int eventR = remote->event("last-syncEvent-"+mCurrentSyncName ); if ( eventR ) { eventRSync = (Event*) eventR->clone(); remote->deleteEvent(eventR ); } else { - if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { + if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL || mSyncKDE) { eventRSync = (Event*)eventLSync->clone(); } else { fullDateRange = true; eventRSync = new Event(); eventRSync->setSummary(mCurrentSyncName + i18n(" - sync event")); eventRSync->setUid("last-syncEvent-"+mCurrentSyncName ); @@ -970,16 +964,16 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int mLastCalendarSync = QDateTime::currentDateTime().addDays( -100*365); else mLastCalendarSync = eventLSync->dtStart(); // for resyncing if own file has changed if ( mCurrentSyncDevice == "deleteaftersync" ) { mLastCalendarSync = loadedFileVersion; - qDebug("setting mLastCalendarSync "); + //qDebug("setting mLastCalendarSync "); } //qDebug("*************************** "); - qDebug("mLastCalendarSync %s ",mLastCalendarSync.toString().latin1() ); + qDebug("mLastCalendarSync %s full: %d",mLastCalendarSync.toString().latin1(), fullDateRange); QPtrList<Incidence> er = remote->rawIncidences(); Incidence* inR = er.first(); Incidence* inL; QProgressBar bar( er.count(),0 ); bar.setCaption (i18n("Syncing - close to abort!") ); @@ -1005,38 +999,31 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int skipIncidence = true; QString idS; qApp->processEvents(); if ( !skipIncidence ) { inL = local->incidence( uid ); if ( inL ) { // maybe conflict - same uid in both calendars - int maxrev = inL->revision(); - if ( maxrev < inR->revision() ) - maxrev = inR->revision(); if ( (take = takeEvent( inL, inR, mode, fullDateRange )) > 0 ) { //qDebug("take %d %s ", take, inL->summary().latin1()); if ( take == 3 ) return false; if ( take == 1 ) {// take local if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); else idS = inR->IDStr(); remote->deleteIncidence( inR ); - if ( inL->revision() < maxrev ) - inL->setRevision( maxrev ); inR = inL->clone(); inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); if ( mGlobalSyncMode != SYNC_MODE_EXTERNAL ) inR->setIDStr( idS ); remote->addIncidence( inR ); if ( mSyncKDE ) inR->setPilotId( 2 ); ++changedRemote; } else { - if ( inR->revision() < maxrev ) - inR->setRevision( maxrev ); idS = inL->IDStr(); int pid = inL->pilotId(); local->deleteIncidence( inL ); inL = inR->clone(); if ( mSyncKDE ) inL->setPilotId( pid ); |