-rw-r--r-- | libkcal/todo.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp index cc1c5ae..5a0c32e 100644 --- a/libkcal/todo.cpp +++ b/libkcal/todo.cpp | |||
@@ -602,49 +602,49 @@ QDateTime Todo::getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_d | |||
602 | // if the recurring todo is set to complete and requested time < start time of todo | 602 | // if the recurring todo is set to complete and requested time < start time of todo |
603 | // we want to get the alarm. | 603 | // we want to get the alarm. |
604 | bool iscompleted = isCompleted(); | 604 | bool iscompleted = isCompleted(); |
605 | if ( iscompleted && doesRecur() ) { | 605 | if ( iscompleted && doesRecur() ) { |
606 | Todo * to = (Todo*) this; | 606 | Todo * to = (Todo*) this; |
607 | to->checkSetCompletedFalse(); | 607 | to->checkSetCompletedFalse(); |
608 | iscompleted = isCompleted(); | 608 | iscompleted = isCompleted(); |
609 | if ( hasStartDate() && start_dt < dtStart() ){ | 609 | if ( hasStartDate() && start_dt < dtStart() ){ |
610 | iscompleted = false; | 610 | iscompleted = false; |
611 | } | 611 | } |
612 | } | 612 | } |
613 | if ( iscompleted ) { | 613 | if ( iscompleted ) { |
614 | return QDateTime (); | 614 | return QDateTime (); |
615 | } | 615 | } |
616 | QDateTime incidenceStart; | 616 | QDateTime incidenceStart; |
617 | incidenceStart = dtDue(); | 617 | incidenceStart = dtDue(); |
618 | bool enabled = false; | 618 | bool enabled = false; |
619 | Alarm* alarm; | 619 | Alarm* alarm; |
620 | int off = 0; | 620 | int off = 0; |
621 | QDateTime alarmStart = QDateTime::currentDateTime().addDays( 3650 );; | 621 | QDateTime alarmStart = QDateTime::currentDateTime().addDays( 3650 );; |
622 | // if ( QDateTime::currentDateTime() > incidenceStart ){ | 622 | // if ( QDateTime::currentDateTime() > incidenceStart ){ |
623 | // *ok = false; | 623 | // *ok = false; |
624 | // return incidenceStart; | 624 | // return incidenceStart; |
625 | // } | 625 | // } |
626 | for (QPtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) { | 626 | for (Q3PtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) { |
627 | if (alarm->enabled()) { | 627 | if (alarm->enabled()) { |
628 | if ( alarm->hasTime () ) { | 628 | if ( alarm->hasTime () ) { |
629 | if ( alarm->time() < alarmStart ) { | 629 | if ( alarm->time() < alarmStart ) { |
630 | alarmStart = alarm->time(); | 630 | alarmStart = alarm->time(); |
631 | enabled = true; | 631 | enabled = true; |
632 | off = alarmStart.secsTo( incidenceStart ); | 632 | off = alarmStart.secsTo( incidenceStart ); |
633 | } | 633 | } |
634 | 634 | ||
635 | } else { | 635 | } else { |
636 | int secs = alarm->startOffset().asSeconds(); | 636 | int secs = alarm->startOffset().asSeconds(); |
637 | if ( incidenceStart.addSecs( secs ) < alarmStart ) { | 637 | if ( incidenceStart.addSecs( secs ) < alarmStart ) { |
638 | alarmStart = incidenceStart.addSecs( secs ); | 638 | alarmStart = incidenceStart.addSecs( secs ); |
639 | enabled = true; | 639 | enabled = true; |
640 | off = -secs; | 640 | off = -secs; |
641 | } | 641 | } |
642 | } | 642 | } |
643 | } | 643 | } |
644 | } | 644 | } |
645 | if ( enabled ) { | 645 | if ( enabled ) { |
646 | if ( alarmStart > start_dt ) { | 646 | if ( alarmStart > start_dt ) { |
647 | *ok = true; | 647 | *ok = true; |
648 | * offset = off; | 648 | * offset = off; |
649 | return alarmStart; | 649 | return alarmStart; |
650 | } | 650 | } |