author | zautrix <zautrix> | 2005-07-30 14:43:57 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-30 14:43:57 (UTC) |
commit | 9ca2cd947f22d33543e065f54c6487e86d80befa (patch) (unidiff) | |
tree | 549192e9e27e8972e2b48cf40e1599118df12da5 /libkcal/calendarlocal.cpp | |
parent | 055928e26613f4ab249bd82be86890ed278372f6 (diff) | |
download | kdepimpi-9ca2cd947f22d33543e065f54c6487e86d80befa.zip kdepimpi-9ca2cd947f22d33543e065f54c6487e86d80befa.tar.gz kdepimpi-9ca2cd947f22d33543e065f54c6487e86d80befa.tar.bz2 |
fixxx
-rw-r--r-- | libkcal/calendarlocal.cpp | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp index e8c969f..1a1c6be 100644 --- a/libkcal/calendarlocal.cpp +++ b/libkcal/calendarlocal.cpp | |||
@@ -239,194 +239,179 @@ bool CalendarLocal::load( const QString &fileName ) | |||
239 | bool CalendarLocal::save( const QString &fileName, CalFormat *format ) | 239 | bool CalendarLocal::save( const QString &fileName, CalFormat *format ) |
240 | { | 240 | { |
241 | FileStorage storage( this, fileName, format ); | 241 | FileStorage storage( this, fileName, format ); |
242 | return storage.save(); | 242 | return storage.save(); |
243 | } | 243 | } |
244 | 244 | ||
245 | void CalendarLocal::stopAllTodos() | 245 | void CalendarLocal::stopAllTodos() |
246 | { | 246 | { |
247 | for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() ) | 247 | for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() ) |
248 | it->setRunning( false ); | 248 | it->setRunning( false ); |
249 | 249 | ||
250 | } | 250 | } |
251 | void CalendarLocal::close() | 251 | void CalendarLocal::close() |
252 | { | 252 | { |
253 | 253 | ||
254 | Todo * i; | 254 | Todo * i; |
255 | for( i = mTodoList.first(); i; i = mTodoList.next() ) i->setRunning(false); | 255 | for( i = mTodoList.first(); i; i = mTodoList.next() ) i->setRunning(false); |
256 | 256 | ||
257 | mEventList.setAutoDelete( true ); | 257 | mEventList.setAutoDelete( true ); |
258 | mTodoList.setAutoDelete( true ); | 258 | mTodoList.setAutoDelete( true ); |
259 | mJournalList.setAutoDelete( true ); | 259 | mJournalList.setAutoDelete( true ); |
260 | 260 | ||
261 | mEventList.clear(); | 261 | mEventList.clear(); |
262 | mTodoList.clear(); | 262 | mTodoList.clear(); |
263 | mJournalList.clear(); | 263 | mJournalList.clear(); |
264 | 264 | ||
265 | mEventList.setAutoDelete( false ); | 265 | mEventList.setAutoDelete( false ); |
266 | mTodoList.setAutoDelete( false ); | 266 | mTodoList.setAutoDelete( false ); |
267 | mJournalList.setAutoDelete( false ); | 267 | mJournalList.setAutoDelete( false ); |
268 | 268 | ||
269 | setModified( false ); | 269 | setModified( false ); |
270 | } | 270 | } |
271 | void CalendarLocal::clearUndo() | 271 | |
272 | { | ||
273 | if ( mUndoIncidence ) { | ||
274 | if ( mUndoIncidence->typeID() == eventID ) | ||
275 | delete ((Event*) mUndoIncidence) ; | ||
276 | else if ( mUndoIncidence->typeID() == todoID ) | ||
277 | delete ( (Todo*) mUndoIncidence ); | ||
278 | else if ( mUndoIncidence->typeID() == journalID ) | ||
279 | delete ( (Journal*) mUndoIncidence ); | ||
280 | else | ||
281 | delete mUndoIncidence; | ||
282 | } | ||
283 | mUndoIncidence = 0; | ||
284 | } | ||
285 | bool CalendarLocal::addAnniversaryNoDup( Event *event ) | 272 | bool CalendarLocal::addAnniversaryNoDup( Event *event ) |
286 | { | 273 | { |
287 | QString cat; | 274 | QString cat; |
288 | bool isBirthday = true; | 275 | bool isBirthday = true; |
289 | if( event->categoriesStr() == i18n( "Anniversary" ) ) { | 276 | if( event->categoriesStr() == i18n( "Anniversary" ) ) { |
290 | isBirthday = false; | 277 | isBirthday = false; |
291 | cat = i18n( "Anniversary" ); | 278 | cat = i18n( "Anniversary" ); |
292 | } else if( event->categoriesStr() == i18n( "Birthday" ) ) { | 279 | } else if( event->categoriesStr() == i18n( "Birthday" ) ) { |
293 | isBirthday = true; | 280 | isBirthday = true; |
294 | cat = i18n( "Birthday" ); | 281 | cat = i18n( "Birthday" ); |
295 | } else { | 282 | } else { |
296 | qDebug("addAnniversaryNoDup called without fitting category! "); | 283 | qDebug("addAnniversaryNoDup called without fitting category! "); |
297 | return false; | 284 | return false; |
298 | } | 285 | } |
299 | Event * eve; | 286 | Event * eve; |
300 | for ( eve = mEventList.first(); eve ; eve = mEventList.next() ) { | 287 | for ( eve = mEventList.first(); eve ; eve = mEventList.next() ) { |
301 | if ( !(eve->categories().contains( cat ) )) | 288 | if ( !(eve->categories().contains( cat ) )) |
302 | continue; | 289 | continue; |
303 | // now we have an event with fitting category | 290 | // now we have an event with fitting category |
304 | if ( eve->dtStart().date() != event->dtStart().date() ) | 291 | if ( eve->dtStart().date() != event->dtStart().date() ) |
305 | continue; | 292 | continue; |
306 | // now we have an event with fitting category+date | 293 | // now we have an event with fitting category+date |
307 | if ( eve->summary() != event->summary() ) | 294 | if ( eve->summary() != event->summary() ) |
308 | continue; | 295 | continue; |
309 | // now we have an event with fitting category+date+summary | 296 | // now we have an event with fitting category+date+summary |
310 | return false; | 297 | return false; |
311 | } | 298 | } |
312 | return addEvent( event ); | 299 | return addEvent( event ); |
313 | 300 | ||
314 | } | 301 | } |
315 | bool CalendarLocal::addEventNoDup( Event *event ) | 302 | bool CalendarLocal::addEventNoDup( Event *event ) |
316 | { | 303 | { |
317 | Event * eve; | 304 | Event * eve; |
318 | for ( eve = mEventList.first(); eve ; eve = mEventList.next() ) { | 305 | for ( eve = mEventList.first(); eve ; eve = mEventList.next() ) { |
319 | if ( *eve == *event ) { | 306 | if ( *eve == *event ) { |
320 | //qDebug("CalendarLocal::Duplicate event found! Not inserted! "); | 307 | //qDebug("CalendarLocal::Duplicate event found! Not inserted! "); |
321 | return false; | 308 | return false; |
322 | } | 309 | } |
323 | } | 310 | } |
324 | return addEvent( event ); | 311 | return addEvent( event ); |
325 | } | 312 | } |
326 | 313 | ||
327 | bool CalendarLocal::addEvent( Event *event ) | 314 | bool CalendarLocal::addEvent( Event *event ) |
328 | { | 315 | { |
329 | insertEvent( event ); | 316 | insertEvent( event ); |
330 | 317 | ||
331 | event->registerObserver( this ); | 318 | event->registerObserver( this ); |
332 | 319 | ||
333 | setModified( true ); | 320 | setModified( true ); |
334 | if ( event->calID() == 0 ) | 321 | if ( event->calID() == 0 ) |
335 | event->setCalID( mDefaultCalendar ); | 322 | event->setCalID( mDefaultCalendar ); |
336 | event->setCalEnabled( true ); | 323 | event->setCalEnabled( true ); |
337 | 324 | ||
338 | return true; | 325 | return true; |
339 | } | 326 | } |
340 | 327 | ||
341 | void CalendarLocal::deleteEvent( Event *event ) | 328 | void CalendarLocal::deleteEvent( Event *event ) |
342 | { | 329 | { |
343 | clearUndo(); | 330 | clearUndo(event); |
344 | mUndoIncidence = event; | ||
345 | if ( mEventList.removeRef( event ) ) { | 331 | if ( mEventList.removeRef( event ) ) { |
346 | setModified( true ); | 332 | setModified( true ); |
347 | } | 333 | } |
348 | } | 334 | } |
349 | 335 | ||
350 | 336 | ||
351 | Event *CalendarLocal::event( const QString &uid ) | 337 | Event *CalendarLocal::event( const QString &uid ) |
352 | { | 338 | { |
353 | Event *event; | 339 | Event *event; |
354 | Event *retVal = 0; | 340 | Event *retVal = 0; |
355 | for ( event = mEventList.first(); event; event = mEventList.next() ) { | 341 | for ( event = mEventList.first(); event; event = mEventList.next() ) { |
356 | if ( event->calEnabled() && event->uid() == uid ) { | 342 | if ( event->calEnabled() && event->uid() == uid ) { |
357 | if ( retVal ) { | 343 | if ( retVal ) { |
358 | if ( retVal->calID() > event->calID() ) { | 344 | if ( retVal->calID() > event->calID() ) { |
359 | retVal = event; | 345 | retVal = event; |
360 | } | 346 | } |
361 | } else { | 347 | } else { |
362 | retVal = event; | 348 | retVal = event; |
363 | } | 349 | } |
364 | } | 350 | } |
365 | } | 351 | } |
366 | return retVal; | 352 | return retVal; |
367 | } | 353 | } |
368 | bool CalendarLocal::addTodoNoDup( Todo *todo ) | 354 | bool CalendarLocal::addTodoNoDup( Todo *todo ) |
369 | { | 355 | { |
370 | Todo * eve; | 356 | Todo * eve; |
371 | for ( eve = mTodoList.first(); eve ; eve = mTodoList.next() ) { | 357 | for ( eve = mTodoList.first(); eve ; eve = mTodoList.next() ) { |
372 | if ( *eve == *todo ) { | 358 | if ( *eve == *todo ) { |
373 | //qDebug("duplicate todo found! not inserted! "); | 359 | //qDebug("duplicate todo found! not inserted! "); |
374 | return false; | 360 | return false; |
375 | } | 361 | } |
376 | } | 362 | } |
377 | return addTodo( todo ); | 363 | return addTodo( todo ); |
378 | } | 364 | } |
379 | bool CalendarLocal::addTodo( Todo *todo ) | 365 | bool CalendarLocal::addTodo( Todo *todo ) |
380 | { | 366 | { |
381 | mTodoList.append( todo ); | 367 | mTodoList.append( todo ); |
382 | 368 | ||
383 | todo->registerObserver( this ); | 369 | todo->registerObserver( this ); |
384 | 370 | ||
385 | // Set up subtask relations | 371 | // Set up subtask relations |
386 | setupRelations( todo ); | 372 | setupRelations( todo ); |
387 | 373 | ||
388 | setModified( true ); | 374 | setModified( true ); |
389 | if ( todo->calID() == 0 ) | 375 | if ( todo->calID() == 0 ) |
390 | todo->setCalID( mDefaultCalendar ); | 376 | todo->setCalID( mDefaultCalendar ); |
391 | todo->setCalEnabled( true ); | 377 | todo->setCalEnabled( true ); |
392 | return true; | 378 | return true; |
393 | } | 379 | } |
394 | 380 | ||
395 | void CalendarLocal::deleteTodo( Todo *todo ) | 381 | void CalendarLocal::deleteTodo( Todo *todo ) |
396 | { | 382 | { |
397 | // Handle orphaned children | 383 | // Handle orphaned children |
398 | clearUndo(); | ||
399 | removeRelations( todo ); | 384 | removeRelations( todo ); |
400 | mUndoIncidence = todo; | 385 | clearUndo(todo); |
401 | 386 | ||
402 | if ( mTodoList.removeRef( todo ) ) { | 387 | if ( mTodoList.removeRef( todo ) ) { |
403 | setModified( true ); | 388 | setModified( true ); |
404 | } | 389 | } |
405 | } | 390 | } |
406 | 391 | ||
407 | QPtrList<Todo> CalendarLocal::rawTodos() | 392 | QPtrList<Todo> CalendarLocal::rawTodos() |
408 | { | 393 | { |
409 | QPtrList<Todo> el; | 394 | QPtrList<Todo> el; |
410 | for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() ) | 395 | for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() ) |
411 | if ( it->calEnabled() ) el.append( it ); | 396 | if ( it->calEnabled() ) el.append( it ); |
412 | return el; | 397 | return el; |
413 | } | 398 | } |
414 | Todo *CalendarLocal::todo( QString syncProf, QString id ) | 399 | Todo *CalendarLocal::todo( QString syncProf, QString id ) |
415 | { | 400 | { |
416 | Todo *todo; | 401 | Todo *todo; |
417 | for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) { | 402 | for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) { |
418 | if ( todo->calEnabled() && todo->getID( syncProf ) == id ) return todo; | 403 | if ( todo->calEnabled() && todo->getID( syncProf ) == id ) return todo; |
419 | } | 404 | } |
420 | 405 | ||
421 | return 0; | 406 | return 0; |
422 | } | 407 | } |
423 | void CalendarLocal::removeSyncInfo( QString syncProfile) | 408 | void CalendarLocal::removeSyncInfo( QString syncProfile) |
424 | { | 409 | { |
425 | QPtrList<Incidence> all = rawIncidences() ; | 410 | QPtrList<Incidence> all = rawIncidences() ; |
426 | Incidence *inc; | 411 | Incidence *inc; |
427 | for ( inc = all.first(); inc; inc = all.next() ) { | 412 | for ( inc = all.first(); inc; inc = all.next() ) { |
428 | inc->removeID( syncProfile ); | 413 | inc->removeID( syncProfile ); |
429 | } | 414 | } |
430 | if ( syncProfile.isEmpty() ) { | 415 | if ( syncProfile.isEmpty() ) { |
431 | QPtrList<Event> el; | 416 | QPtrList<Event> el; |
432 | Event *todo; | 417 | Event *todo; |
@@ -870,66 +855,65 @@ QPtrList<Event> CalendarLocal::rawEvents( const QDate &start, const QDate &end, | |||
870 | 855 | ||
871 | return eventList; | 856 | return eventList; |
872 | } | 857 | } |
873 | 858 | ||
874 | QPtrList<Event> CalendarLocal::rawEventsForDate( const QDateTime &qdt ) | 859 | QPtrList<Event> CalendarLocal::rawEventsForDate( const QDateTime &qdt ) |
875 | { | 860 | { |
876 | return rawEventsForDate( qdt.date() ); | 861 | return rawEventsForDate( qdt.date() ); |
877 | } | 862 | } |
878 | 863 | ||
879 | QPtrList<Event> CalendarLocal::rawEvents() | 864 | QPtrList<Event> CalendarLocal::rawEvents() |
880 | { | 865 | { |
881 | QPtrList<Event> el; | 866 | QPtrList<Event> el; |
882 | for ( Event *it = mEventList.first(); it; it = mEventList.next() ) | 867 | for ( Event *it = mEventList.first(); it; it = mEventList.next() ) |
883 | if ( it->calEnabled() ) el.append( it ); | 868 | if ( it->calEnabled() ) el.append( it ); |
884 | return el; | 869 | return el; |
885 | } | 870 | } |
886 | 871 | ||
887 | bool CalendarLocal::addJournal(Journal *journal) | 872 | bool CalendarLocal::addJournal(Journal *journal) |
888 | { | 873 | { |
889 | mJournalList.append(journal); | 874 | mJournalList.append(journal); |
890 | 875 | ||
891 | journal->registerObserver( this ); | 876 | journal->registerObserver( this ); |
892 | 877 | ||
893 | setModified( true ); | 878 | setModified( true ); |
894 | if ( journal->calID() == 0 ) | 879 | if ( journal->calID() == 0 ) |
895 | journal->setCalID( mDefaultCalendar ); | 880 | journal->setCalID( mDefaultCalendar ); |
896 | journal->setCalEnabled( true ); | 881 | journal->setCalEnabled( true ); |
897 | return true; | 882 | return true; |
898 | } | 883 | } |
899 | 884 | ||
900 | void CalendarLocal::deleteJournal( Journal *journal ) | 885 | void CalendarLocal::deleteJournal( Journal *journal ) |
901 | { | 886 | { |
902 | clearUndo(); | 887 | clearUndo(journal); |
903 | mUndoIncidence = journal; | ||
904 | if ( mJournalList.removeRef(journal) ) { | 888 | if ( mJournalList.removeRef(journal) ) { |
905 | setModified( true ); | 889 | setModified( true ); |
906 | } | 890 | } |
907 | } | 891 | } |
908 | 892 | ||
909 | QPtrList<Journal> CalendarLocal::journals4Date( const QDate & date ) | 893 | QPtrList<Journal> CalendarLocal::journals4Date( const QDate & date ) |
910 | { | 894 | { |
911 | QPtrList<Journal> el; | 895 | QPtrList<Journal> el; |
912 | for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) | 896 | for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) |
913 | if ( it->calEnabled() && it->dtStart().date() == date) el.append( it ); | 897 | if ( it->calEnabled() && it->dtStart().date() == date) el.append( it ); |
914 | return el; | 898 | return el; |
915 | } | 899 | } |
916 | Journal *CalendarLocal::journal( const QDate &date ) | 900 | Journal *CalendarLocal::journal( const QDate &date ) |
917 | { | 901 | { |
918 | // kdDebug(5800) << "CalendarLocal::journal() " << date.toString() << endl; | 902 | // kdDebug(5800) << "CalendarLocal::journal() " << date.toString() << endl; |
919 | 903 | ||
920 | for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) | 904 | for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) |
921 | if ( it->calEnabled() && it->dtStart().date() == date ) | 905 | if ( it->calEnabled() && it->dtStart().date() == date ) |
922 | return it; | 906 | return it; |
923 | 907 | ||
924 | return 0; | 908 | return 0; |
925 | } | 909 | } |
926 | 910 | ||
927 | Journal *CalendarLocal::journal( const QString &uid ) | 911 | Journal *CalendarLocal::journal( const QString &uid ) |
928 | { | 912 | { |
929 | Journal * retVal = 0; | 913 | Journal * retVal = 0; |
930 | for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) | 914 | for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) |
931 | if ( it->calEnabled() && it->uid() == uid ) { | 915 | if ( it->calEnabled() && it->uid() == uid ) { |
932 | if ( retVal ) { | 916 | if ( retVal ) { |
933 | if ( retVal->calID() > it->calID() ) { | 917 | if ( retVal->calID() > it->calID() ) { |
934 | retVal = it; | 918 | retVal = it; |
935 | } | 919 | } |
@@ -950,65 +934,65 @@ QPtrList<Journal> CalendarLocal::journals() | |||
950 | void CalendarLocal::setCalendarRemove( int id ) | 934 | void CalendarLocal::setCalendarRemove( int id ) |
951 | { | 935 | { |
952 | 936 | ||
953 | { | 937 | { |
954 | QPtrList<Event> EventList = mEventList; | 938 | QPtrList<Event> EventList = mEventList; |
955 | Event * ev = EventList.first(); | 939 | Event * ev = EventList.first(); |
956 | while ( ev ) { | 940 | while ( ev ) { |
957 | if ( ev->calID() == id ) | 941 | if ( ev->calID() == id ) |
958 | deleteEvent( ev ); | 942 | deleteEvent( ev ); |
959 | ev = EventList.next(); | 943 | ev = EventList.next(); |
960 | } | 944 | } |
961 | } | 945 | } |
962 | { | 946 | { |
963 | 947 | ||
964 | QPtrList<Todo> TodoList = mTodoList; | 948 | QPtrList<Todo> TodoList = mTodoList; |
965 | Todo * ev = TodoList.first(); | 949 | Todo * ev = TodoList.first(); |
966 | while ( ev ) { | 950 | while ( ev ) { |
967 | if ( ev->calID() == id ) | 951 | if ( ev->calID() == id ) |
968 | deleteTodo( ev ); | 952 | deleteTodo( ev ); |
969 | ev = TodoList.next(); | 953 | ev = TodoList.next(); |
970 | } | 954 | } |
971 | } | 955 | } |
972 | { | 956 | { |
973 | QPtrList<Journal> JournalList = mJournalList; | 957 | QPtrList<Journal> JournalList = mJournalList; |
974 | Journal * ev = JournalList.first(); | 958 | Journal * ev = JournalList.first(); |
975 | while ( ev ) { | 959 | while ( ev ) { |
976 | if ( ev->calID() == id ) | 960 | if ( ev->calID() == id ) |
977 | deleteJournal( ev ); | 961 | deleteJournal( ev ); |
978 | ev = JournalList.next(); | 962 | ev = JournalList.next(); |
979 | } | 963 | } |
980 | } | 964 | } |
981 | 965 | ||
982 | clearUndo(); | 966 | clearUndo(0); |
983 | 967 | ||
984 | } | 968 | } |
985 | 969 | ||
986 | void CalendarLocal::setCalendarEnabled( int id, bool enable ) | 970 | void CalendarLocal::setCalendarEnabled( int id, bool enable ) |
987 | { | 971 | { |
988 | for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) | 972 | for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) |
989 | if ( it->calID() == id ) it->setCalEnabled( enable ); | 973 | if ( it->calID() == id ) it->setCalEnabled( enable ); |
990 | 974 | ||
991 | for ( Event *it = mEventList.first(); it; it = mEventList.next() ) | 975 | for ( Event *it = mEventList.first(); it; it = mEventList.next() ) |
992 | if ( it->calID() == id ) it->setCalEnabled( enable ); | 976 | if ( it->calID() == id ) it->setCalEnabled( enable ); |
993 | 977 | ||
994 | for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() ) | 978 | for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() ) |
995 | if ( it->calID() == id ) it->setCalEnabled( enable ); | 979 | if ( it->calID() == id ) it->setCalEnabled( enable ); |
996 | 980 | ||
997 | } | 981 | } |
998 | 982 | ||
999 | void CalendarLocal::setReadOnly( int id, bool enable ) | 983 | void CalendarLocal::setReadOnly( int id, bool enable ) |
1000 | { | 984 | { |
1001 | for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) | 985 | for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) |
1002 | if ( it->calID() == id ) it->setReadOnly( enable ); | 986 | if ( it->calID() == id ) it->setReadOnly( enable ); |
1003 | 987 | ||
1004 | for ( Event *it = mEventList.first(); it; it = mEventList.next() ) | 988 | for ( Event *it = mEventList.first(); it; it = mEventList.next() ) |
1005 | if ( it->calID() == id ) it->setReadOnly( enable ); | 989 | if ( it->calID() == id ) it->setReadOnly( enable ); |
1006 | 990 | ||
1007 | for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() ) | 991 | for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() ) |
1008 | if ( it->calID() == id ) it->setReadOnly( enable ); | 992 | if ( it->calID() == id ) it->setReadOnly( enable ); |
1009 | 993 | ||
1010 | } | 994 | } |
1011 | 995 | ||
1012 | void CalendarLocal::setAlarmEnabled( int id, bool enable ) | 996 | void CalendarLocal::setAlarmEnabled( int id, bool enable ) |
1013 | { | 997 | { |
1014 | for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) | 998 | for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) |