author | zautrix <zautrix> | 2005-11-28 05:15:27 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-11-28 05:15:27 (UTC) |
commit | 1267a02fc23575f82247f8bd8449dc70dab62d44 (patch) (unidiff) | |
tree | fda71877c6b590a3a5035e310c03950e1081b06f | |
parent | b7522a13b64225bb91bdab4a21b44282f8c3e3b4 (diff) | |
download | kdepimpi-1267a02fc23575f82247f8bd8449dc70dab62d44.zip kdepimpi-1267a02fc23575f82247f8bd8449dc70dab62d44.tar.gz kdepimpi-1267a02fc23575f82247f8bd8449dc70dab62d44.tar.bz2 |
sync
-rw-r--r-- | libkcal/calendarlocal.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp index 8a5a76f..ce3cd09 100644 --- a/libkcal/calendarlocal.cpp +++ b/libkcal/calendarlocal.cpp | |||
@@ -254,95 +254,95 @@ void CalendarLocal::setSyncEventsReadOnly() | |||
254 | ev = mEventList.next(); | 254 | ev = mEventList.next(); |
255 | } | 255 | } |
256 | } | 256 | } |
257 | 257 | ||
258 | void CalendarLocal::addCalendar( Calendar* cal ) | 258 | void CalendarLocal::addCalendar( Calendar* cal ) |
259 | { | 259 | { |
260 | cal->setDontDeleteIncidencesOnClose(); | 260 | cal->setDontDeleteIncidencesOnClose(); |
261 | setSyncEventsEnabled(); | 261 | setSyncEventsEnabled(); |
262 | QPtrList<Incidence> incList; | 262 | QPtrList<Incidence> incList; |
263 | { | 263 | { |
264 | QPtrList<Event> EventList = cal->rawEvents(); | 264 | QPtrList<Event> EventList = cal->rawEvents(); |
265 | Event * ev = EventList.first(); | 265 | Event * ev = EventList.first(); |
266 | while ( ev ) { | 266 | while ( ev ) { |
267 | if ( ev->uid().left( 15 ) == QString("last-syncEvent-") ) { | 267 | if ( ev->uid().left( 15 ) == QString("last-syncEvent-") ) { |
268 | ev->setCalID_block( 1 ); | 268 | ev->setCalID_block( 1 ); |
269 | } | 269 | } |
270 | Event * se = event( ev->uid() ); | 270 | Event * se = event( ev->uid() ); |
271 | if ( se ) | 271 | if ( se ) |
272 | incList.append( se ); | 272 | incList.append( se ); |
273 | ev->unRegisterObserver( cal ); | 273 | ev->unRegisterObserver( cal ); |
274 | ev->registerObserver( this ); | 274 | ev->registerObserver( this ); |
275 | mEventList.append( ev ); | 275 | mEventList.append( ev ); |
276 | ev = EventList.next(); | 276 | ev = EventList.next(); |
277 | } | 277 | } |
278 | 278 | ||
279 | } | 279 | } |
280 | { | 280 | { |
281 | 281 | ||
282 | QPtrList<Todo> TodoList = cal->rawTodos(); | 282 | QPtrList<Todo> TodoList = cal->rawTodos(); |
283 | Todo * ev = TodoList.first(); | 283 | Todo * ev = TodoList.first(); |
284 | while ( ev ) { | 284 | while ( ev ) { |
285 | ev->resetRelatedTo(); | 285 | ev->resetRelatedTo(); |
286 | ev = TodoList.next(); | 286 | Todo * se = todo( ev->uid() ); |
287 | if ( se ) | ||
288 | deleteTodo( se ); | ||
289 | ev = TodoList.next(); | ||
287 | } | 290 | } |
288 | //TodoList = cal->rawTodos(); | 291 | //TodoList = cal->rawTodos(); |
289 | ev = TodoList.first(); | 292 | ev = TodoList.first(); |
290 | while ( ev ) { | 293 | while ( ev ) { |
291 | Todo * se = todo( ev->uid() ); | ||
292 | if ( se ) | ||
293 | incList.append( se ); | ||
294 | ev->unRegisterObserver( cal ); | 294 | ev->unRegisterObserver( cal ); |
295 | ev->registerObserver( this ); | 295 | ev->registerObserver( this ); |
296 | mTodoList.append( ev ); | 296 | mTodoList.append( ev ); |
297 | setupRelations( ev ); | 297 | setupRelations( ev ); |
298 | ev = TodoList.next(); | 298 | ev = TodoList.next(); |
299 | } | 299 | } |
300 | } | 300 | } |
301 | { | 301 | { |
302 | QPtrList<Journal> JournalList = cal->journals(); | 302 | QPtrList<Journal> JournalList = cal->journals(); |
303 | Journal * ev = JournalList.first(); | 303 | Journal * ev = JournalList.first(); |
304 | while ( ev ) { | 304 | while ( ev ) { |
305 | Journal * se = journal( ev->uid() ); | 305 | Journal * se = journal( ev->uid() ); |
306 | if ( se ) | 306 | if ( se ) |
307 | incList.append( se ); | 307 | incList.append( se ); |
308 | ev->unRegisterObserver( cal ); | 308 | ev->unRegisterObserver( cal ); |
309 | ev->registerObserver( this ); | 309 | ev->registerObserver( this ); |
310 | mJournalList.append( ev ); | 310 | mJournalList.append( ev ); |
311 | ev = JournalList.next(); | 311 | ev = JournalList.next(); |
312 | } | 312 | } |
313 | } | 313 | } |
314 | { | 314 | { |
315 | for (Incidence * ev = incList.first(); ev; ev = incList.next() ) { | 315 | for (Incidence * inc = incList.first(); inc; inc = incList.next() ) { |
316 | deleteIncidence ( ev ); | 316 | deleteIncidence ( inc ); |
317 | } | 317 | } |
318 | } | 318 | } |
319 | setModified( true ); | 319 | setModified( true ); |
320 | } | 320 | } |
321 | bool CalendarLocal::load( const QString &fileName ) | 321 | bool CalendarLocal::load( const QString &fileName ) |
322 | { | 322 | { |
323 | FileStorage storage( this, fileName ); | 323 | FileStorage storage( this, fileName ); |
324 | return storage.load(); | 324 | return storage.load(); |
325 | } | 325 | } |
326 | 326 | ||
327 | bool CalendarLocal::save( const QString &fileName, CalFormat *format ) | 327 | bool CalendarLocal::save( const QString &fileName, CalFormat *format ) |
328 | { | 328 | { |
329 | FileStorage storage( this, fileName, format ); | 329 | FileStorage storage( this, fileName, format ); |
330 | return storage.save(); | 330 | return storage.save(); |
331 | } | 331 | } |
332 | 332 | ||
333 | void CalendarLocal::stopAllTodos() | 333 | void CalendarLocal::stopAllTodos() |
334 | { | 334 | { |
335 | for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() ) | 335 | for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() ) |
336 | it->setRunning( false ); | 336 | it->setRunning( false ); |
337 | 337 | ||
338 | } | 338 | } |
339 | void CalendarLocal::close() | 339 | void CalendarLocal::close() |
340 | { | 340 | { |
341 | 341 | ||
342 | Todo * i; | 342 | Todo * i; |
343 | for( i = mTodoList.first(); i; i = mTodoList.next() ) i->setRunning(false); | 343 | for( i = mTodoList.first(); i; i = mTodoList.next() ) i->setRunning(false); |
344 | 344 | ||
345 | mEventList.setAutoDelete( true ); | 345 | mEventList.setAutoDelete( true ); |
346 | mTodoList.setAutoDelete( true ); | 346 | mTodoList.setAutoDelete( true ); |
347 | mJournalList.setAutoDelete( true ); | 347 | mJournalList.setAutoDelete( true ); |
348 | 348 | ||