summaryrefslogtreecommitdiffabout
path: root/libkcal/incidence.cpp
Unidiff
Diffstat (limited to 'libkcal/incidence.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/incidence.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp
index dbc159c..0684af2 100644
--- a/libkcal/incidence.cpp
+++ b/libkcal/incidence.cpp
@@ -618,32 +618,41 @@ QDateTime Incidence::getNextOccurence( const QDateTime& dt, bool* ok ) const
618 ++count; 618 ++count;
619 incidenceStart = recurrence()->getNextDateTime( incidenceStart, &last ); 619 incidenceStart = recurrence()->getNextDateTime( incidenceStart, &last );
620 if ( recursOn( incidenceStart.date() ) ) { 620 if ( recursOn( incidenceStart.date() ) ) {
621 last = true; // exit while llop 621 last = true; // exit while llop
622 } else { 622 } else {
623 if ( last ) { // no alarm on last recurrence 623 if ( last ) { // no alarm on last recurrence
624 return QDateTime (); 624 return QDateTime ();
625 } 625 }
626 int year = incidenceStart.date().year(); 626 int year = incidenceStart.date().year();
627 // workaround for bug in recurrence 627 // workaround for bug in recurrence
628 if ( count == 100 || year < 1000 || year > 5000 ) { 628 if ( count == 100 || year < 1000 || year > 5000 ) {
629 return QDateTime (); 629 return QDateTime ();
630 } 630 }
631 incidenceStart = incidenceStart.addSecs( 1 ); 631 incidenceStart = incidenceStart.addSecs( 1 );
632 } 632 }
633 } 633 }
634 } else { 634 } else {
635 return QDateTime (); 635 return QDateTime ();
636 } 636 }
637 } else { 637 } else {
638 if ( hasStartDate () ) { 638 if ( hasStartDate () ) {
639 incidenceStart = dtStart(); 639 incidenceStart = dtStart();
640 } 640 }
641 if ( type() =="Todo" ) { 641 if ( type() =="Todo" ) {
642 if ( ((Todo*)this)->hasDueDate() ) 642 if ( ((Todo*)this)->hasDueDate() )
643 incidenceStart = ((Todo*)this)->dtDue(); 643 incidenceStart = ((Todo*)this)->dtDue();
644 } 644 }
645 } 645 }
646 if ( incidenceStart > dt ) 646 if ( incidenceStart > dt )
647 *ok = true; 647 *ok = true;
648 return incidenceStart; 648 return incidenceStart;
649} 649}
650QDateTime Incidence::dtStart() const
651{
652 if ( doesRecur() ) {
653 if ( type() == "Todo" ) {
654 ((Todo*)this)->checkSetCompletedFalse();
655 }
656 }
657 return mDtStart;
658}