-rw-r--r-- | korganizer/calendarview.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index fab4540..5150455 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -726,9 +726,9 @@ int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , b // 3 cancel QDateTime lastSync = mLastCalendarSync; if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { bool remCh, locCh; - remCh = ( remote->zaurusUid() != local->zaurusUid() ); + remCh = ( remote->getCsum(mCurrentSyncDevice) != local->getCsum(mCurrentSyncDevice) ); locCh = ( local->lastModified() > mLastCalendarSync ); //qDebug("locCh %d remCh %d locuid %d remuid %d", locCh, remCh,local->zaurusUid(), remote->zaurusUid() ); if ( !remCh && ! locCh ) { //qDebug("both not changed "); @@ -772,9 +772,9 @@ int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , b equ = (*((Journal*) local) == *((Journal*) remote)); if ( equ ) { //qDebug("equal "); if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { - local->setZaurusUid( remote->zaurusUid() ); + local->setCsum( mCurrentSyncDevice, remote->getCsum(mCurrentSyncDevice) ); } if ( mode < SYNC_PREF_FORCE_LOCAL ) return 0; @@ -894,15 +894,15 @@ void CalendarView::checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* t Event* eve = lastSync.first(); while ( eve ) { - int id = toDelete->getID( eve->uid().mid( 15 ) ); // this is the sync profile name - if ( id >= 0 ) { + QString id = toDelete->getID( eve->uid().mid( 15 ) ); // this is the sync profile name + if ( !id.isEmpty() ) { QString des = eve->description(); QString pref = "e"; if ( toDelete->type() == "Todo" ) pref = "t"; - des += pref+ QString::number ( id ) + ","; + des += pref+ id + ","; eve->setReadOnly( false ); eve->setDescription( des ); eve->setReadOnly( true ); } @@ -1012,9 +1012,9 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int //qDebug("take %d %s ", take, inL->summary().latin1()); if ( take == 3 ) return false; if ( take == 1 ) {// take local - inL->setZaurusUid( inR->zaurusUid() ); + inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); remote->deleteIncidence( inR ); if ( inL->revision() < maxrev ) inL->setRevision( maxrev ); remote->addIncidence( inL->clone() ); @@ -1032,9 +1032,9 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int QString des = eventLSync->description(); QString pref = "e"; if ( inR->type() == "Todo" ) pref = "t"; - if ( des.find(pref+QString::number( inR->getID(mCurrentSyncDevice) ) +"," ) >= 0 && mode != 5) { // delete it + if ( des.find(pref+ inR->getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it inR->setTempSyncStat( SYNC_TEMPSTATE_DELETE ); //remote->deleteIncidence( inR ); ++deletedEventR; } else { @@ -1082,14 +1082,14 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int if ( !skipIncidence ) { inR = remote->incidence( uid ); if ( ! inR ) { if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { - if ( inL->getID(mCurrentSyncDevice) >= 0 && mode != 4 ) { + if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { local->deleteIncidence( inL ); ++deletedEventL; } else { if ( ! KOPrefs::instance()->mWriteBackExistingOnly ) { - inL->setID(mCurrentSyncDevice, -1 ); + inL->removeID(mCurrentSyncDevice ); ++addedEventR; inL->setLastModified( modifiedCalendar ); remote->addIncidence( inL->clone() ); } @@ -1207,9 +1207,9 @@ void CalendarView::syncSharp() if ( inc->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) { loc = mCalendar->incidence(inc->uid() ); if ( loc ) { loc->setID(mCurrentSyncDevice, inc->getID(mCurrentSyncDevice) ); - loc->setZaurusUid( inc->zaurusUid() ); + loc->setCsum( mCurrentSyncDevice, inc->getCsum(mCurrentSyncDevice) ); } } inc = iL.next(); } |