summaryrefslogtreecommitdiffabout
path: root/libkcal
Unidiff
Diffstat (limited to 'libkcal') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/calendarlocal.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp
index 52c298b..5c889c3 100644
--- a/libkcal/calendarlocal.cpp
+++ b/libkcal/calendarlocal.cpp
@@ -277,48 +277,49 @@ Todo *CalendarLocal::todo( const QString &uid )
277 277
278 return 0; 278 return 0;
279} 279}
280QString CalendarLocal::nextSummary() const 280QString CalendarLocal::nextSummary() const
281{ 281{
282 return mNextSummary; 282 return mNextSummary;
283} 283}
284QDateTime CalendarLocal::nextAlarmEventDateTime() const 284QDateTime CalendarLocal::nextAlarmEventDateTime() const
285{ 285{
286 return mNextAlarmEventDateTime; 286 return mNextAlarmEventDateTime;
287} 287}
288void CalendarLocal::checkAlarmForIncidence( Incidence * incidence, bool deleted) 288void CalendarLocal::checkAlarmForIncidence( Incidence * incidence, bool deleted)
289{ 289{
290 //mNextAlarmIncidence 290 //mNextAlarmIncidence
291 //mNextAlarmDateTime 291 //mNextAlarmDateTime
292 //return mNextSummary; 292 //return mNextSummary;
293 //return mNextAlarmEventDateTime; 293 //return mNextAlarmEventDateTime;
294 bool newNextAlarm = false; 294 bool newNextAlarm = false;
295 bool computeNextAlarm = false; 295 bool computeNextAlarm = false;
296 bool ok; 296 bool ok;
297 int offset; 297 int offset;
298 QDateTime nextA; 298 QDateTime nextA;
299 // QString nextSum; 299 // QString nextSum;
300 //QDateTime nextEvent; 300 //QDateTime nextEvent;
301 mNextAlarmEventDateTime = QDateTime();
301 if ( mNextAlarmIncidence == 0 || incidence == 0 ) { 302 if ( mNextAlarmIncidence == 0 || incidence == 0 ) {
302 computeNextAlarm = true; 303 computeNextAlarm = true;
303 } else { 304 } else {
304 if ( ! deleted ) { 305 if ( ! deleted ) {
305 nextA = incidence->getNextAlarmDateTime(& ok, &offset ) ; 306 nextA = incidence->getNextAlarmDateTime(& ok, &offset ) ;
306 if ( ok ) { 307 if ( ok ) {
307 if ( nextA < mNextAlarmDateTime ) { 308 if ( nextA < mNextAlarmDateTime ) {
308 deRegisterAlarm(); 309 deRegisterAlarm();
309 mNextAlarmDateTime = nextA; 310 mNextAlarmDateTime = nextA;
310 mNextSummary = incidence->summary(); 311 mNextSummary = incidence->summary();
311 mNextAlarmEventDateTime = nextA.addSecs(offset ) ; 312 mNextAlarmEventDateTime = nextA.addSecs(offset ) ;
312 mNextAlarmEventDateTimeString = KGlobal::locale()->formatDateTime(mNextAlarmEventDateTime); 313 mNextAlarmEventDateTimeString = KGlobal::locale()->formatDateTime(mNextAlarmEventDateTime);
313 newNextAlarm = true; 314 newNextAlarm = true;
314 mNextAlarmIncidence = incidence; 315 mNextAlarmIncidence = incidence;
315 } else { 316 } else {
316 if ( incidence == mNextAlarmIncidence ) { 317 if ( incidence == mNextAlarmIncidence ) {
317 computeNextAlarm = true; 318 computeNextAlarm = true;
318 } 319 }
319 } 320 }
320 } else { 321 } else {
321 if ( mNextAlarmIncidence == incidence ) { 322 if ( mNextAlarmIncidence == incidence ) {
322 computeNextAlarm = true; 323 computeNextAlarm = true;
323 } 324 }
324 } 325 }