rem: for (Event* msg = messages.first();  msg;  msg = messages.next()) addEntry(KAlarmEvent(*msg));
add: KAlarmEvent event; Event::List events; Event::List::ConstIterator it; QDateTime now = QDateTime::currentDateTime(); if (mShowExpired) { AlarmCalendar* calendar = theApp()->expiredCalendar(); if (!calendar) kdError(5950) << "AlarmListView::refresh(): failed to open expired calendar\n"; else { events = calendar->events(); for (it = events.begin();  it != events.end();  ++it) { Event* kcalEvent = *it; if (kcalEvent->alarms().count() > 0) { event.set(*kcalEvent); addEntry(event, now); } } } } events = theApp()->getCalendar().events(); for (it = events.begin();  it != events.end();  ++it) { Event* kcalEvent = *it; event.set(*kcalEvent); if (mShowExpired  ||  !event.expired()) addEntry(event, now); }
context: void AlarmListView::refresh(){	QPtrList<Event> messages = theApp()->getCalendar().getAllEvents();	clear();	for (Event* msg = messages.first();  msg;  msg = messages.next())		addEntry(KAlarmEvent(*msg));	resizeLastColumn();}