-rw-r--r-- | korganizer/komonthview.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 004ff50..cb69832 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -1257,15 +1257,18 @@ void KOMonthView::updateView() QDateTime dt; bool ok; QDate endDate = mStartDate.addDays( timeSpan ); for( event = events.first(); event; event = events.next() ) { // for event if ( event->doesRecur() ) { bool last; + qDebug("********************************************** "); + qDebug("Event summary: %s ", event->summary().latin1()); QDateTime incidenceStart = event->recurrence()->getPreviousDateTime( QDateTime( mStartDate ) , &last ); QDateTime incidenceEnd; int eventlen = event->dtStart().date().daysTo ( event->dtEnd().date() ); + qDebug("eventlen %d ", eventlen); bool invalid = false; while( true ) { if ( incidenceStart.isValid() ) { incidenceEnd = incidenceStart.addDays( eventlen ); int st = incidenceStart.date().daysTo( endDate ); if ( st >= 0 ) { // start before timeend @@ -1282,24 +1285,30 @@ void KOMonthView::updateView() } } } else { if ( invalid ) break; invalid = true; - //qDebug("invalid %s", event->summary().latin1()); + qDebug("invalid %s", event->summary().latin1()); incidenceStart = QDateTime( mStartDate ).addSecs( -2 );; } if ( last ) break; bool ok; + qDebug("TRY next occurence %s ", incidenceStart.toString().latin1()); incidenceStart = event->getNextOccurence( incidenceStart.addSecs( 1 ) ,&ok ); - if ( ! ok ) + if ( ! ok ) { + qDebug("NOT OK "); break; - if ( incidenceStart.date() > endDate ) + } + if ( incidenceStart.date() > endDate ) { + qDebug("incidenceStart.date() > endDate "); break; } + qDebug("next occurence %s ", incidenceStart.toString().latin1()); + } } else { // no recur int st = event->dtStart().date().daysTo( endDate ); if ( st >= 0 ) { // start before timeend int end = mStartDate.daysTo( event->dtEnd().date() ); if ( end >= 0 ) { // end after timestart --- got one! //normalize |