summaryrefslogtreecommitdiffabout
path: root/libkcal/calendarlocal.cpp
authorzautrix <zautrix>2004-10-26 22:19:18 (UTC)
committer zautrix <zautrix>2004-10-26 22:19:18 (UTC)
commit6385f303bef3cbcd19d097a7b05c30e144d5dd6e (patch) (unidiff)
tree770795d94ea6ec1dc8bcaa67cc174a9c0add564a /libkcal/calendarlocal.cpp
parent13e996beddabc5e88f4f2fe49b2ce6cb8408eb30 (diff)
downloadkdepimpi-6385f303bef3cbcd19d097a7b05c30e144d5dd6e.zip
kdepimpi-6385f303bef3cbcd19d097a7b05c30e144d5dd6e.tar.gz
kdepimpi-6385f303bef3cbcd19d097a7b05c30e144d5dd6e.tar.bz2
implemented remove sync info for kopi and kapi
Diffstat (limited to 'libkcal/calendarlocal.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/calendarlocal.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp
index 21b4aaf..3f46d53 100644
--- a/libkcal/calendarlocal.cpp
+++ b/libkcal/calendarlocal.cpp
@@ -32,385 +32,406 @@
32#include "vcaldrag.h" 32#include "vcaldrag.h"
33#include "vcalformat.h" 33#include "vcalformat.h"
34#include "icalformat.h" 34#include "icalformat.h"
35#include "exceptions.h" 35#include "exceptions.h"
36#include "incidence.h" 36#include "incidence.h"
37#include "journal.h" 37#include "journal.h"
38#include "filestorage.h" 38#include "filestorage.h"
39#include "calfilter.h" 39#include "calfilter.h"
40 40
41#include "calendarlocal.h" 41#include "calendarlocal.h"
42 42
43// #ifndef DESKTOP_VERSION 43// #ifndef DESKTOP_VERSION
44// #include <qtopia/alarmserver.h> 44// #include <qtopia/alarmserver.h>
45// #endif 45// #endif
46using namespace KCal; 46using namespace KCal;
47 47
48CalendarLocal::CalendarLocal() 48CalendarLocal::CalendarLocal()
49 : Calendar() 49 : Calendar()
50{ 50{
51 init(); 51 init();
52} 52}
53 53
54CalendarLocal::CalendarLocal(const QString &timeZoneId) 54CalendarLocal::CalendarLocal(const QString &timeZoneId)
55 : Calendar(timeZoneId) 55 : Calendar(timeZoneId)
56{ 56{
57 init(); 57 init();
58} 58}
59 59
60void CalendarLocal::init() 60void CalendarLocal::init()
61{ 61{
62 mNextAlarmIncidence = 0; 62 mNextAlarmIncidence = 0;
63} 63}
64 64
65 65
66CalendarLocal::~CalendarLocal() 66CalendarLocal::~CalendarLocal()
67{ 67{
68 close(); 68 close();
69} 69}
70 70
71bool CalendarLocal::load( const QString &fileName ) 71bool CalendarLocal::load( const QString &fileName )
72{ 72{
73 FileStorage storage( this, fileName ); 73 FileStorage storage( this, fileName );
74 return storage.load(); 74 return storage.load();
75} 75}
76 76
77bool CalendarLocal::save( const QString &fileName, CalFormat *format ) 77bool CalendarLocal::save( const QString &fileName, CalFormat *format )
78{ 78{
79 FileStorage storage( this, fileName, format ); 79 FileStorage storage( this, fileName, format );
80 return storage.save(); 80 return storage.save();
81} 81}
82 82
83void CalendarLocal::close() 83void CalendarLocal::close()
84{ 84{
85 mEventList.setAutoDelete( true ); 85 mEventList.setAutoDelete( true );
86 mTodoList.setAutoDelete( true ); 86 mTodoList.setAutoDelete( true );
87 mJournalList.setAutoDelete( false ); 87 mJournalList.setAutoDelete( false );
88 88
89 mEventList.clear(); 89 mEventList.clear();
90 mTodoList.clear(); 90 mTodoList.clear();
91 mJournalList.clear(); 91 mJournalList.clear();
92 92
93 mEventList.setAutoDelete( false ); 93 mEventList.setAutoDelete( false );
94 mTodoList.setAutoDelete( false ); 94 mTodoList.setAutoDelete( false );
95 mJournalList.setAutoDelete( false ); 95 mJournalList.setAutoDelete( false );
96 96
97 setModified( false ); 97 setModified( false );
98} 98}
99 99
100bool CalendarLocal::addAnniversaryNoDup( Event *event ) 100bool CalendarLocal::addAnniversaryNoDup( Event *event )
101{ 101{
102 QString cat; 102 QString cat;
103 bool isBirthday = true; 103 bool isBirthday = true;
104 if( event->categoriesStr() == i18n( "Anniversary" ) ) { 104 if( event->categoriesStr() == i18n( "Anniversary" ) ) {
105 isBirthday = false; 105 isBirthday = false;
106 cat = i18n( "Anniversary" ); 106 cat = i18n( "Anniversary" );
107 } else if( event->categoriesStr() == i18n( "Birthday" ) ) { 107 } else if( event->categoriesStr() == i18n( "Birthday" ) ) {
108 isBirthday = true; 108 isBirthday = true;
109 cat = i18n( "Birthday" ); 109 cat = i18n( "Birthday" );
110 } else { 110 } else {
111 qDebug("addAnniversaryNoDup called without fitting category! "); 111 qDebug("addAnniversaryNoDup called without fitting category! ");
112 return false; 112 return false;
113 } 113 }
114 Event * eve; 114 Event * eve;
115 for ( eve = mEventList.first(); eve ; eve = mEventList.next() ) { 115 for ( eve = mEventList.first(); eve ; eve = mEventList.next() ) {
116 if ( !(eve->categories().contains( cat ) )) 116 if ( !(eve->categories().contains( cat ) ))
117 continue; 117 continue;
118 // now we have an event with fitting category 118 // now we have an event with fitting category
119 if ( eve->dtStart().date() != event->dtStart().date() ) 119 if ( eve->dtStart().date() != event->dtStart().date() )
120 continue; 120 continue;
121 // now we have an event with fitting category+date 121 // now we have an event with fitting category+date
122 if ( eve->summary() != event->summary() ) 122 if ( eve->summary() != event->summary() )
123 continue; 123 continue;
124 // now we have an event with fitting category+date+summary 124 // now we have an event with fitting category+date+summary
125 return false; 125 return false;
126 } 126 }
127 return addEvent( event ); 127 return addEvent( event );
128 128
129} 129}
130bool CalendarLocal::addEventNoDup( Event *event ) 130bool CalendarLocal::addEventNoDup( Event *event )
131{ 131{
132 Event * eve; 132 Event * eve;
133 for ( eve = mEventList.first(); eve ; eve = mEventList.next() ) { 133 for ( eve = mEventList.first(); eve ; eve = mEventList.next() ) {
134 if ( *eve == *event ) { 134 if ( *eve == *event ) {
135 //qDebug("CalendarLocal::Duplicate event found! Not inserted! "); 135 //qDebug("CalendarLocal::Duplicate event found! Not inserted! ");
136 return false; 136 return false;
137 } 137 }
138 } 138 }
139 return addEvent( event ); 139 return addEvent( event );
140} 140}
141 141
142bool CalendarLocal::addEvent( Event *event ) 142bool CalendarLocal::addEvent( Event *event )
143{ 143{
144 insertEvent( event ); 144 insertEvent( event );
145 145
146 event->registerObserver( this ); 146 event->registerObserver( this );
147 147
148 setModified( true ); 148 setModified( true );
149 149
150 return true; 150 return true;
151} 151}
152 152
153void CalendarLocal::deleteEvent( Event *event ) 153void CalendarLocal::deleteEvent( Event *event )
154{ 154{
155 155
156 156
157 if ( mEventList.removeRef( event ) ) { 157 if ( mEventList.removeRef( event ) ) {
158 setModified( true ); 158 setModified( true );
159 } 159 }
160} 160}
161 161
162 162
163Event *CalendarLocal::event( const QString &uid ) 163Event *CalendarLocal::event( const QString &uid )
164{ 164{
165 165
166 Event *event; 166 Event *event;
167 167
168 for ( event = mEventList.first(); event; event = mEventList.next() ) { 168 for ( event = mEventList.first(); event; event = mEventList.next() ) {
169 if ( event->uid() == uid ) { 169 if ( event->uid() == uid ) {
170 return event; 170 return event;
171 } 171 }
172 } 172 }
173 173
174 return 0; 174 return 0;
175} 175}
176bool CalendarLocal::addTodoNoDup( Todo *todo ) 176bool CalendarLocal::addTodoNoDup( Todo *todo )
177{ 177{
178 Todo * eve; 178 Todo * eve;
179 for ( eve = mTodoList.first(); eve ; eve = mTodoList.next() ) { 179 for ( eve = mTodoList.first(); eve ; eve = mTodoList.next() ) {
180 if ( *eve == *todo ) { 180 if ( *eve == *todo ) {
181 //qDebug("duplicate todo found! not inserted! "); 181 //qDebug("duplicate todo found! not inserted! ");
182 return false; 182 return false;
183 } 183 }
184 } 184 }
185 return addTodo( todo ); 185 return addTodo( todo );
186} 186}
187bool CalendarLocal::addTodo( Todo *todo ) 187bool CalendarLocal::addTodo( Todo *todo )
188{ 188{
189 mTodoList.append( todo ); 189 mTodoList.append( todo );
190 190
191 todo->registerObserver( this ); 191 todo->registerObserver( this );
192 192
193 // Set up subtask relations 193 // Set up subtask relations
194 setupRelations( todo ); 194 setupRelations( todo );
195 195
196 setModified( true ); 196 setModified( true );
197 197
198 return true; 198 return true;
199} 199}
200 200
201void CalendarLocal::deleteTodo( Todo *todo ) 201void CalendarLocal::deleteTodo( Todo *todo )
202{ 202{
203 // Handle orphaned children 203 // Handle orphaned children
204 removeRelations( todo ); 204 removeRelations( todo );
205 205
206 if ( mTodoList.removeRef( todo ) ) { 206 if ( mTodoList.removeRef( todo ) ) {
207 setModified( true ); 207 setModified( true );
208 } 208 }
209} 209}
210 210
211QPtrList<Todo> CalendarLocal::rawTodos() 211QPtrList<Todo> CalendarLocal::rawTodos()
212{ 212{
213 return mTodoList; 213 return mTodoList;
214} 214}
215Todo *CalendarLocal::todo( QString syncProf, QString id ) 215Todo *CalendarLocal::todo( QString syncProf, QString id )
216{ 216{
217 Todo *todo; 217 Todo *todo;
218 for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) { 218 for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) {
219 if ( todo->getID( syncProf ) == id ) return todo; 219 if ( todo->getID( syncProf ) == id ) return todo;
220 } 220 }
221 221
222 return 0; 222 return 0;
223} 223}
224 224void CalendarLocal::removeSyncInfo( QString syncProfile)
225{
226 QPtrList<Incidence> all = rawIncidences() ;
227 Incidence *inc;
228 for ( inc = all.first(); inc; inc = all.next() ) {
229 inc->removeID( syncProfile );
230 }
231 if ( syncProfile.isEmpty() ) {
232 QPtrList<Event> el;
233 Event *todo;
234 for ( todo = mEventList.first(); todo; todo = mEventList.next() ) {
235 if ( todo->uid().left( 15 ) == QString("last-syncEvent-") )
236 el.append( todo );
237 }
238 for ( todo = el.first(); todo; todo = el.next() ) {
239 deleteIncidence ( todo );
240 }
241 } else {
242 Event *lse = event( "last-syncEvent-"+ syncProfile);
243 deleteIncidence ( lse );
244 }
245}
225QPtrList<Event> CalendarLocal::getExternLastSyncEvents() 246QPtrList<Event> CalendarLocal::getExternLastSyncEvents()
226{ 247{
227 QPtrList<Event> el; 248 QPtrList<Event> el;
228 Event *todo; 249 Event *todo;
229 for ( todo = mEventList.first(); todo; todo = mEventList.next() ) { 250 for ( todo = mEventList.first(); todo; todo = mEventList.next() ) {
230 if ( todo->uid().left( 15 ) == QString("last-syncEvent-") ) 251 if ( todo->uid().left( 15 ) == QString("last-syncEvent-") )
231 if ( todo->summary().left(3) == "E: " ) 252 if ( todo->summary().left(3) == "E: " )
232 el.append( todo ); 253 el.append( todo );
233 } 254 }
234 255
235 return el; 256 return el;
236 257
237} 258}
238Event *CalendarLocal::event( QString syncProf, QString id ) 259Event *CalendarLocal::event( QString syncProf, QString id )
239{ 260{
240 Event *todo; 261 Event *todo;
241 for ( todo = mEventList.first(); todo; todo = mEventList.next() ) { 262 for ( todo = mEventList.first(); todo; todo = mEventList.next() ) {
242 if ( todo->getID( syncProf ) == id ) return todo; 263 if ( todo->getID( syncProf ) == id ) return todo;
243 } 264 }
244 265
245 return 0; 266 return 0;
246} 267}
247Todo *CalendarLocal::todo( const QString &uid ) 268Todo *CalendarLocal::todo( const QString &uid )
248{ 269{
249 Todo *todo; 270 Todo *todo;
250 for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) { 271 for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) {
251 if ( todo->uid() == uid ) return todo; 272 if ( todo->uid() == uid ) return todo;
252 } 273 }
253 274
254 return 0; 275 return 0;
255} 276}
256QString CalendarLocal::nextSummary() const 277QString CalendarLocal::nextSummary() const
257{ 278{
258 return mNextSummary; 279 return mNextSummary;
259} 280}
260QDateTime CalendarLocal::nextAlarmEventDateTime() const 281QDateTime CalendarLocal::nextAlarmEventDateTime() const
261{ 282{
262 return mNextAlarmEventDateTime; 283 return mNextAlarmEventDateTime;
263} 284}
264void CalendarLocal::checkAlarmForIncidence( Incidence * incidence, bool deleted) 285void CalendarLocal::checkAlarmForIncidence( Incidence * incidence, bool deleted)
265{ 286{
266 //mNextAlarmIncidence 287 //mNextAlarmIncidence
267 //mNextAlarmDateTime 288 //mNextAlarmDateTime
268 //return mNextSummary; 289 //return mNextSummary;
269 //return mNextAlarmEventDateTime; 290 //return mNextAlarmEventDateTime;
270 bool newNextAlarm = false; 291 bool newNextAlarm = false;
271 bool computeNextAlarm = false; 292 bool computeNextAlarm = false;
272 bool ok; 293 bool ok;
273 int offset; 294 int offset;
274 QDateTime nextA; 295 QDateTime nextA;
275 // QString nextSum; 296 // QString nextSum;
276 //QDateTime nextEvent; 297 //QDateTime nextEvent;
277 if ( mNextAlarmIncidence == 0 || incidence == 0 ) { 298 if ( mNextAlarmIncidence == 0 || incidence == 0 ) {
278 computeNextAlarm = true; 299 computeNextAlarm = true;
279 } else { 300 } else {
280 if ( ! deleted ) { 301 if ( ! deleted ) {
281 nextA = incidence->getNextAlarmDateTime(& ok, &offset ) ; 302 nextA = incidence->getNextAlarmDateTime(& ok, &offset ) ;
282 if ( ok ) { 303 if ( ok ) {
283 if ( nextA < mNextAlarmDateTime ) { 304 if ( nextA < mNextAlarmDateTime ) {
284 deRegisterAlarm(); 305 deRegisterAlarm();
285 mNextAlarmDateTime = nextA; 306 mNextAlarmDateTime = nextA;
286 mNextSummary = incidence->summary(); 307 mNextSummary = incidence->summary();
287 mNextAlarmEventDateTime = nextA.addSecs(offset ) ; 308 mNextAlarmEventDateTime = nextA.addSecs(offset ) ;
288 mNextAlarmEventDateTimeString = KGlobal::locale()->formatDateTime(mNextAlarmEventDateTime); 309 mNextAlarmEventDateTimeString = KGlobal::locale()->formatDateTime(mNextAlarmEventDateTime);
289 newNextAlarm = true; 310 newNextAlarm = true;
290 mNextAlarmIncidence = incidence; 311 mNextAlarmIncidence = incidence;
291 } else { 312 } else {
292 if ( incidence == mNextAlarmIncidence ) { 313 if ( incidence == mNextAlarmIncidence ) {
293 computeNextAlarm = true; 314 computeNextAlarm = true;
294 } 315 }
295 } 316 }
296 } else { 317 } else {
297 if ( mNextAlarmIncidence == incidence ) { 318 if ( mNextAlarmIncidence == incidence ) {
298 computeNextAlarm = true; 319 computeNextAlarm = true;
299 } 320 }
300 } 321 }
301 } else { // deleted 322 } else { // deleted
302 if ( incidence == mNextAlarmIncidence ) { 323 if ( incidence == mNextAlarmIncidence ) {
303 computeNextAlarm = true; 324 computeNextAlarm = true;
304 } 325 }
305 } 326 }
306 } 327 }
307 if ( computeNextAlarm ) { 328 if ( computeNextAlarm ) {
308 deRegisterAlarm(); 329 deRegisterAlarm();
309 nextA = nextAlarm( 1000 ); 330 nextA = nextAlarm( 1000 );
310 if (! mNextAlarmIncidence ) { 331 if (! mNextAlarmIncidence ) {
311 return; 332 return;
312 } 333 }
313 newNextAlarm = true; 334 newNextAlarm = true;
314 } 335 }
315 if ( newNextAlarm ) 336 if ( newNextAlarm )
316 registerAlarm(); 337 registerAlarm();
317} 338}
318QString CalendarLocal:: getAlarmNotification() 339QString CalendarLocal:: getAlarmNotification()
319{ 340{
320 QString ret; 341 QString ret;
321 // this should not happen 342 // this should not happen
322 if (! mNextAlarmIncidence ) 343 if (! mNextAlarmIncidence )
323 return "cal_alarm"+ mNextSummary.left( 25 )+"\n"+mNextAlarmEventDateTimeString; 344 return "cal_alarm"+ mNextSummary.left( 25 )+"\n"+mNextAlarmEventDateTimeString;
324 Alarm* alarm = mNextAlarmIncidence->alarms().first(); 345 Alarm* alarm = mNextAlarmIncidence->alarms().first();
325 if ( alarm->type() == Alarm::Procedure ) { 346 if ( alarm->type() == Alarm::Procedure ) {
326 ret = "proc_alarm" + alarm->programFile()+"+++"; 347 ret = "proc_alarm" + alarm->programFile()+"+++";
327 } else { 348 } else {
328 ret = "audio_alarm" +alarm->audioFile() +"+++"; 349 ret = "audio_alarm" +alarm->audioFile() +"+++";
329 } 350 }
330 ret += "cal_alarm"+ mNextSummary.left( 25 ); 351 ret += "cal_alarm"+ mNextSummary.left( 25 );
331 if ( mNextSummary.length() > 25 ) 352 if ( mNextSummary.length() > 25 )
332 ret += "\n" + mNextSummary.mid(25, 25 ); 353 ret += "\n" + mNextSummary.mid(25, 25 );
333 ret+= "\n"+mNextAlarmEventDateTimeString; 354 ret+= "\n"+mNextAlarmEventDateTimeString;
334 return ret; 355 return ret;
335} 356}
336void CalendarLocal::registerAlarm() 357void CalendarLocal::registerAlarm()
337{ 358{
338 mLastAlarmNotificationString = getAlarmNotification(); 359 mLastAlarmNotificationString = getAlarmNotification();
339 // qDebug("++ register Alarm %s %s",mNextAlarmDateTime.toString().latin1(), mLastAlarmNotificationString.latin1() ); 360 // qDebug("++ register Alarm %s %s",mNextAlarmDateTime.toString().latin1(), mLastAlarmNotificationString.latin1() );
340 emit addAlarm ( mNextAlarmDateTime, mLastAlarmNotificationString ); 361 emit addAlarm ( mNextAlarmDateTime, mLastAlarmNotificationString );
341// #ifndef DESKTOP_VERSION 362// #ifndef DESKTOP_VERSION
342// AlarmServer::addAlarm ( mNextAlarmDateTime,"koalarm", mLastAlarmNotificationString.latin1() ); 363// AlarmServer::addAlarm ( mNextAlarmDateTime,"koalarm", mLastAlarmNotificationString.latin1() );
343// #endif 364// #endif
344} 365}
345void CalendarLocal::deRegisterAlarm() 366void CalendarLocal::deRegisterAlarm()
346{ 367{
347 if ( mLastAlarmNotificationString.isNull() ) 368 if ( mLastAlarmNotificationString.isNull() )
348 return; 369 return;
349 //qDebug("-- deregister Alarm %s ", mLastAlarmNotificationString.latin1() ); 370 //qDebug("-- deregister Alarm %s ", mLastAlarmNotificationString.latin1() );
350 371
351 emit removeAlarm ( mNextAlarmDateTime, mLastAlarmNotificationString ); 372 emit removeAlarm ( mNextAlarmDateTime, mLastAlarmNotificationString );
352// #ifndef DESKTOP_VERSION 373// #ifndef DESKTOP_VERSION
353// AlarmServer::deleteAlarm (mNextAlarmDateTime ,"koalarm" ,mLastAlarmNotificationString.latin1() ); 374// AlarmServer::deleteAlarm (mNextAlarmDateTime ,"koalarm" ,mLastAlarmNotificationString.latin1() );
354// #endif 375// #endif
355} 376}
356 377
357QPtrList<Todo> CalendarLocal::todos( const QDate &date ) 378QPtrList<Todo> CalendarLocal::todos( const QDate &date )
358{ 379{
359 QPtrList<Todo> todos; 380 QPtrList<Todo> todos;
360 381
361 Todo *todo; 382 Todo *todo;
362 for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) { 383 for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) {
363 if ( todo->hasDueDate() && todo->dtDue().date() == date ) { 384 if ( todo->hasDueDate() && todo->dtDue().date() == date ) {
364 todos.append( todo ); 385 todos.append( todo );
365 } 386 }
366 } 387 }
367 388
368 filter()->apply( &todos ); 389 filter()->apply( &todos );
369 return todos; 390 return todos;
370} 391}
371void CalendarLocal::reInitAlarmSettings() 392void CalendarLocal::reInitAlarmSettings()
372{ 393{
373 if ( !mNextAlarmIncidence ) { 394 if ( !mNextAlarmIncidence ) {
374 nextAlarm( 1000 ); 395 nextAlarm( 1000 );
375 } 396 }
376 deRegisterAlarm(); 397 deRegisterAlarm();
377 mNextAlarmIncidence = 0; 398 mNextAlarmIncidence = 0;
378 checkAlarmForIncidence( 0, false ); 399 checkAlarmForIncidence( 0, false );
379 400
380} 401}
381 402
382 403
383 404
384QDateTime CalendarLocal::nextAlarm( int daysTo ) 405QDateTime CalendarLocal::nextAlarm( int daysTo )
385{ 406{
386 QDateTime nextA = QDateTime::currentDateTime().addDays( daysTo ); 407 QDateTime nextA = QDateTime::currentDateTime().addDays( daysTo );
387 QDateTime start = QDateTime::currentDateTime().addSecs( 30 ); 408 QDateTime start = QDateTime::currentDateTime().addSecs( 30 );
388 QDateTime next; 409 QDateTime next;
389 Event *e; 410 Event *e;
390 bool ok; 411 bool ok;
391 bool found = false; 412 bool found = false;
392 int offset; 413 int offset;
393 mNextAlarmIncidence = 0; 414 mNextAlarmIncidence = 0;
394 for( e = mEventList.first(); e; e = mEventList.next() ) { 415 for( e = mEventList.first(); e; e = mEventList.next() ) {
395 next = e->getNextAlarmDateTime(& ok, &offset ) ; 416 next = e->getNextAlarmDateTime(& ok, &offset ) ;
396 if ( ok ) { 417 if ( ok ) {
397 if ( next < nextA ) { 418 if ( next < nextA ) {
398 nextA = next; 419 nextA = next;
399 found = true; 420 found = true;
400 mNextSummary = e->summary(); 421 mNextSummary = e->summary();
401 mNextAlarmEventDateTime = next.addSecs(offset ) ; 422 mNextAlarmEventDateTime = next.addSecs(offset ) ;
402 mNextAlarmIncidence = (Incidence *) e; 423 mNextAlarmIncidence = (Incidence *) e;
403 } 424 }
404 } 425 }
405 } 426 }
406 Todo *t; 427 Todo *t;
407 for( t = mTodoList.first(); t; t = mTodoList.next() ) { 428 for( t = mTodoList.first(); t; t = mTodoList.next() ) {
408 next = t->getNextAlarmDateTime(& ok, &offset ) ; 429 next = t->getNextAlarmDateTime(& ok, &offset ) ;
409 if ( ok ) { 430 if ( ok ) {
410 if ( next < nextA ) { 431 if ( next < nextA ) {
411 nextA = next; 432 nextA = next;
412 found = true; 433 found = true;
413 mNextSummary = t->summary(); 434 mNextSummary = t->summary();
414 mNextAlarmEventDateTime = next.addSecs(offset ); 435 mNextAlarmEventDateTime = next.addSecs(offset );
415 mNextAlarmIncidence = (Incidence *) t; 436 mNextAlarmIncidence = (Incidence *) t;
416 } 437 }