-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 @@ -727,7 +727,7 @@ int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , b 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 ) { @@ -773,7 +773,7 @@ int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , b 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; @@ -895,13 +895,13 @@ 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 ); @@ -1013,7 +1013,7 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int 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 ); @@ -1033,7 +1033,7 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int 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; @@ -1083,12 +1083,12 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int 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() ); @@ -1208,7 +1208,7 @@ void CalendarView::syncSharp() 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(); |