-rw-r--r-- | libkcal/calendarlocal.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp index c82ea92..b02f706 100644 --- a/libkcal/calendarlocal.cpp +++ b/libkcal/calendarlocal.cpp | |||
@@ -140,30 +140,30 @@ bool CalendarLocal::mergeCalendar( Calendar* remote ) | |||
140 | deleteIncidence( inL ); | 140 | deleteIncidence( inL ); |
141 | inL = localInc.next(); | 141 | inL = localInc.next(); |
142 | } | 142 | } |
143 | QPtrList<Incidence> er = remote->rawIncidences(); | 143 | QPtrList<Incidence> er = remote->rawIncidences(); |
144 | Incidence* inR = er.first(); | 144 | Incidence* inR = er.first(); |
145 | while ( inR ) { | 145 | while ( inR ) { |
146 | inL = incidenceForUid( inR->uid(),false ); | 146 | inL = incidenceForUid( inR->uid(),false ); |
147 | if ( inL ) { | 147 | if ( inL ) { |
148 | if ( ! inL->isReadOnly () || inL->uid().left(15) == QString("last-syncEvent-") ) { | 148 | if ( ! inL->isReadOnly () || inL->uid().left(15) == QString("last-syncEvent-") ) { |
149 | int calID = inL->calID(); | 149 | int calID = inL->calID(); |
150 | deleteIncidence( inL ); | 150 | deleteIncidence( inL ); |
151 | inL = inR->clone(); | 151 | inL = inR->clone(); |
152 | inL->setCalID( calID ); | 152 | inL->setCalID_block( calID ); |
153 | addIncidence( inL ); | 153 | addIncidence( inL ); |
154 | } | 154 | } |
155 | } else { | 155 | } else { |
156 | inL = inR->clone(); | 156 | inL = inR->clone(); |
157 | inL->setCalID( 0 );// add to default cal | 157 | inL->setCalID_block( 0 );// add to default cal |
158 | addIncidence( inL ); | 158 | addIncidence( inL ); |
159 | } | 159 | } |
160 | inR = er.next(); | 160 | inR = er.next(); |
161 | } | 161 | } |
162 | return true; | 162 | return true; |
163 | } | 163 | } |
164 | 164 | ||
165 | 165 | ||
166 | bool CalendarLocal::addCalendarFile( QString name, int id ) | 166 | bool CalendarLocal::addCalendarFile( QString name, int id ) |
167 | { | 167 | { |
168 | CalendarLocal calendar( timeZoneId() ); | 168 | CalendarLocal calendar( timeZoneId() ); |
169 | calendar.setDefaultCalendar( id ); | 169 | calendar.setDefaultCalendar( id ); |
@@ -199,25 +199,25 @@ void CalendarLocal::addCalendar( Calendar* cal ) | |||
199 | { | 199 | { |
200 | cal->setDontDeleteIncidencesOnClose(); | 200 | cal->setDontDeleteIncidencesOnClose(); |
201 | setSyncEventsEnabled(); | 201 | setSyncEventsEnabled(); |
202 | { | 202 | { |
203 | QPtrList<Event> EventList = cal->rawEvents(); | 203 | QPtrList<Event> EventList = cal->rawEvents(); |
204 | QPtrList<Event> el; | 204 | QPtrList<Event> el; |
205 | Event * ev = EventList.first(); | 205 | Event * ev = EventList.first(); |
206 | while ( ev ) { | 206 | while ( ev ) { |
207 | if ( ev->uid().left( 15 ) == QString("last-syncEvent-") ) { | 207 | if ( ev->uid().left( 15 ) == QString("last-syncEvent-") ) { |
208 | Event * se = event( ev->uid() ); | 208 | Event * se = event( ev->uid() ); |
209 | if ( se ) | 209 | if ( se ) |
210 | el.append( se ); | 210 | el.append( se ); |
211 | ev->setCalID( 1 ); | 211 | ev->setCalID_block( 1 ); |
212 | } | 212 | } |
213 | ev->unRegisterObserver( cal ); | 213 | ev->unRegisterObserver( cal ); |
214 | ev->registerObserver( this ); | 214 | ev->registerObserver( this ); |
215 | mEventList.append( ev ); | 215 | mEventList.append( ev ); |
216 | ev = EventList.next(); | 216 | ev = EventList.next(); |
217 | } | 217 | } |
218 | for ( ev = el.first(); ev; ev = el.next() ) { | 218 | for ( ev = el.first(); ev; ev = el.next() ) { |
219 | deleteIncidence ( ev ); | 219 | deleteIncidence ( ev ); |
220 | } | 220 | } |
221 | } | 221 | } |
222 | { | 222 | { |
223 | 223 | ||
@@ -333,25 +333,25 @@ bool CalendarLocal::addEventNoDup( Event *event ) | |||
333 | } | 333 | } |
334 | return addEvent( event ); | 334 | return addEvent( event ); |
335 | } | 335 | } |
336 | 336 | ||
337 | bool CalendarLocal::addEvent( Event *event ) | 337 | bool CalendarLocal::addEvent( Event *event ) |
338 | { | 338 | { |
339 | insertEvent( event ); | 339 | insertEvent( event ); |
340 | 340 | ||
341 | event->registerObserver( this ); | 341 | event->registerObserver( this ); |
342 | 342 | ||
343 | setModified( true ); | 343 | setModified( true ); |
344 | if ( event->calID() == 0 ) | 344 | if ( event->calID() == 0 ) |
345 | event->setCalID( mDefaultCalendar ); | 345 | event->setCalID_block( mDefaultCalendar ); |
346 | event->setCalEnabled( true ); | 346 | event->setCalEnabled( true ); |
347 | 347 | ||
348 | return true; | 348 | return true; |
349 | } | 349 | } |
350 | 350 | ||
351 | void CalendarLocal::deleteEvent( Event *event ) | 351 | void CalendarLocal::deleteEvent( Event *event ) |
352 | { | 352 | { |
353 | clearUndo(event); | 353 | clearUndo(event); |
354 | if ( mEventList.removeRef( event ) ) { | 354 | if ( mEventList.removeRef( event ) ) { |
355 | setModified( true ); | 355 | setModified( true ); |
356 | } | 356 | } |
357 | } | 357 | } |
@@ -387,25 +387,25 @@ bool CalendarLocal::addTodoNoDup( Todo *todo ) | |||
387 | } | 387 | } |
388 | bool CalendarLocal::addTodo( Todo *todo ) | 388 | bool CalendarLocal::addTodo( Todo *todo ) |
389 | { | 389 | { |
390 | mTodoList.append( todo ); | 390 | mTodoList.append( todo ); |
391 | 391 | ||
392 | todo->registerObserver( this ); | 392 | todo->registerObserver( this ); |
393 | 393 | ||
394 | // Set up subtask relations | 394 | // Set up subtask relations |
395 | setupRelations( todo ); | 395 | setupRelations( todo ); |
396 | 396 | ||
397 | setModified( true ); | 397 | setModified( true ); |
398 | if ( todo->calID() == 0 ) | 398 | if ( todo->calID() == 0 ) |
399 | todo->setCalID( mDefaultCalendar ); | 399 | todo->setCalID_block( mDefaultCalendar ); |
400 | todo->setCalEnabled( true ); | 400 | todo->setCalEnabled( true ); |
401 | return true; | 401 | return true; |
402 | } | 402 | } |
403 | 403 | ||
404 | void CalendarLocal::deleteTodo( Todo *todo ) | 404 | void CalendarLocal::deleteTodo( Todo *todo ) |
405 | { | 405 | { |
406 | // Handle orphaned children | 406 | // Handle orphaned children |
407 | removeRelations( todo ); | 407 | removeRelations( todo ); |
408 | clearUndo(todo); | 408 | clearUndo(todo); |
409 | 409 | ||
410 | if ( mTodoList.removeRef( todo ) ) { | 410 | if ( mTodoList.removeRef( todo ) ) { |
411 | setModified( true ); | 411 | setModified( true ); |
@@ -915,25 +915,25 @@ QPtrList<Event> CalendarLocal::rawEvents() | |||
915 | if ( it->calEnabled() ) el.append( it ); | 915 | if ( it->calEnabled() ) el.append( it ); |
916 | return el; | 916 | return el; |
917 | } | 917 | } |
918 | 918 | ||
919 | bool CalendarLocal::addJournal(Journal *journal) | 919 | bool CalendarLocal::addJournal(Journal *journal) |
920 | { | 920 | { |
921 | mJournalList.append(journal); | 921 | mJournalList.append(journal); |
922 | 922 | ||
923 | journal->registerObserver( this ); | 923 | journal->registerObserver( this ); |
924 | 924 | ||
925 | setModified( true ); | 925 | setModified( true ); |
926 | if ( journal->calID() == 0 ) | 926 | if ( journal->calID() == 0 ) |
927 | journal->setCalID( mDefaultCalendar ); | 927 | journal->setCalID_block( mDefaultCalendar ); |
928 | journal->setCalEnabled( true ); | 928 | journal->setCalEnabled( true ); |
929 | return true; | 929 | return true; |
930 | } | 930 | } |
931 | 931 | ||
932 | void CalendarLocal::deleteJournal( Journal *journal ) | 932 | void CalendarLocal::deleteJournal( Journal *journal ) |
933 | { | 933 | { |
934 | clearUndo(journal); | 934 | clearUndo(journal); |
935 | if ( mJournalList.removeRef(journal) ) { | 935 | if ( mJournalList.removeRef(journal) ) { |
936 | setModified( true ); | 936 | setModified( true ); |
937 | } | 937 | } |
938 | } | 938 | } |
939 | 939 | ||