-rw-r--r-- | korganizer/calendarview.cpp | 43 | ||||
-rw-r--r-- | korganizer/calendarview.h | 2 |
2 files changed, 18 insertions, 27 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 9160e1d..cbe2a10 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -911,2 +911,8 @@ void CalendarView::checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* t } +void CalendarView::checkExternalId( Incidence * inc ) +{ + QPtrList<Event> lastSync = mCalendar->getExternLastSyncEvents() ; + checkExternSyncEvent( lastSync, inc ); + +} bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int mode ) @@ -1028,3 +1034,3 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int pref = "t"; - if ( des.find(pref+QString::number( inR->zaurusId() ) +"," ) >= 0 && mode != 5) { // delete it + if ( des.find(pref+QString::number( inR->getID(mCurrentSyncDevice) ) +"," ) >= 0 && mode != 5) { // delete it inR->setTempSyncStat( SYNC_TEMPSTATE_DELETE ); @@ -1078,3 +1084,3 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { - if ( inL->zaurusId() >= 0 && mode != 4 ) { + if ( inL->getID(mCurrentSyncDevice) >= 0 && mode != 4 ) { local->deleteIncidence( inL ); @@ -1083,3 +1089,3 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int if ( ! KOPrefs::instance()->mWriteBackExistingOnly ) { - inL->setZaurusId( -1 ); + inL->setID(mCurrentSyncDevice, -1 ); ++addedEventR; @@ -1202,3 +1208,3 @@ void CalendarView::syncSharp() if ( loc ) { - loc->setZaurusId( inc->zaurusId() ); + loc->setID(mCurrentSyncDevice, inc->getID(mCurrentSyncDevice) ); loc->setZaurusUid( inc->zaurusUid() ); @@ -1831,18 +1837,3 @@ void CalendarView::changeTodoDisplay(Todo *which, int action) } -void CalendarView::checkZaurusId( int id, bool todo ) -{ - if ( id >= 0 ) { - Incidence* lse = mCalendar->event( "last-syncEvent-Sharp-DTM"); - if ( lse ) { - QString des = lse->description(); - QString pref = "e"; - if ( todo ) - pref = "t"; - des += pref+ QString::number ( id ) + ","; - lse->setReadOnly( false ); - lse->setDescription( des ); - lse->setReadOnly( true ); - } - } -} + void CalendarView::changeIncidenceDisplay(Incidence *which, int action) @@ -2578,3 +2569,3 @@ void CalendarView::deleteTodo(Todo *todo) } else { - checkZaurusId( todo->zaurusId(), true ); + checkExternalId( todo ); calendar()->deleteTodo(todo); @@ -2590,3 +2581,3 @@ void CalendarView::deleteTodo(Todo *todo) } else { - checkZaurusId( todo->zaurusId(), true ); + checkExternalId( todo ); mCalendar->deleteTodo(todo); @@ -2652,3 +2643,3 @@ void CalendarView::deleteEvent(Event *anEvent) - checkZaurusId( anEvent->zaurusId()); + checkExternalId( anEvent); mCalendar->deleteEvent(anEvent); @@ -2686,3 +2677,3 @@ void CalendarView::deleteEvent(Event *anEvent) schedule(Scheduler::Cancel,anEvent); - checkZaurusId( anEvent->zaurusId()); + checkExternalId( anEvent); mCalendar->deleteEvent(anEvent); @@ -2694,3 +2685,3 @@ void CalendarView::deleteEvent(Event *anEvent) schedule(Scheduler::Cancel,anEvent); - checkZaurusId( anEvent->zaurusId()); + checkExternalId( anEvent); mCalendar->deleteEvent(anEvent); @@ -3448,3 +3439,3 @@ bool CalendarView::removeCompletedSubTodos( Todo* t ) if ( t->isCompleted() ) { - checkZaurusId( t->zaurusId(), true ); + checkExternalId( t ); mCalendar->deleteTodo( t ); diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 557554f..f7a1213 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h @@ -485,3 +485,3 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser void checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete ); - void checkZaurusId( int id, bool todo = false ); + void checkExternalId( Incidence * inc ); int mGlobalSyncMode; |