-rw-r--r-- | libkcal/todo.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp index 7bf756a..e4508a0 100644 --- a/libkcal/todo.cpp +++ b/libkcal/todo.cpp | |||
@@ -585,32 +585,42 @@ QDateTime Todo::getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_d | |||
585 | } | 585 | } |
586 | } | 586 | } |
587 | } | 587 | } |
588 | if ( enabled ) { | 588 | if ( enabled ) { |
589 | if ( alarmStart > start_dt ) { | 589 | if ( alarmStart > start_dt ) { |
590 | *ok = true; | 590 | *ok = true; |
591 | * offset = off; | 591 | * offset = off; |
592 | return alarmStart; | 592 | return alarmStart; |
593 | } | 593 | } |
594 | } | 594 | } |
595 | *ok = false; | 595 | *ok = false; |
596 | return QDateTime (); | 596 | return QDateTime (); |
597 | 597 | ||
598 | } | 598 | } |
599 | 599 | ||
600 | void Todo::checkSetCompletedFalse() | 600 | void Todo::checkSetCompletedFalse() |
601 | { | 601 | { |
602 | if ( !mHasRecurrenceID ) { | 602 | if ( !mHasRecurrenceID ) { |
603 | qDebug("ERROR 1 in Todo::checkSetCompletedFalse"); | 603 | qDebug("ERROR 1 in Todo::checkSetCompletedFalse"); |
604 | return; | 604 | return; |
605 | } | 605 | } |
606 | // qDebug("Todo::checkSetCompletedFalse()"); | 606 | // qDebug("Todo::checkSetCompletedFalse()"); |
607 | //qDebug("%s %s %s ",mDtStart.toString().latin1(), dtDue().toString().latin1(),mRecurrenceID.toString().latin1() ); | 607 | //qDebug("%s %s %s ",mDtStart.toString().latin1(), dtDue().toString().latin1(),mRecurrenceID.toString().latin1() ); |
608 | if ( mPercentComplete == 100 ) { | 608 | if ( mPercentComplete == 100 ) { |
609 | QDateTime dt = QDateTime::currentDateTime(); | 609 | QDateTime dt = QDateTime::currentDateTime(); |
610 | if ( dt > mDtStart && dt > mRecurrenceID ) { | 610 | if ( dt > mDtStart && dt > mRecurrenceID ) { |
611 | qDebug("start: %s --due: %s --recID: %s ",mDtStart.toString().latin1(), dtDue().toString().latin1(),mRecurrenceID.toString().latin1() ); | 611 | qDebug("start: %s --due: %s --recID: %s ",mDtStart.toString().latin1(), dtDue().toString().latin1(),mRecurrenceID.toString().latin1() ); |
612 | setCompleted( false ); | 612 | setCompleted( false ); |
613 | qDebug("Todo::checkSetCompletedFalse "); | 613 | qDebug("Todo::checkSetCompletedFalse "); |
614 | } | 614 | } |
615 | } | 615 | } |
616 | } | 616 | } |
617 | QString Todo::durationText() | ||
618 | { | ||
619 | if ( mHasDueDate && hasStartDate() ) { | ||
620 | int sec = dtStart().secsTo( dtDue() ); | ||
621 | if ( doesFloat() ) | ||
622 | sec += 86400; | ||
623 | return durationText4Time( sec ); | ||
624 | } | ||
625 | return "---"; | ||
626 | } | ||