From b3b9d2e1b0435cd8943922759c8091d2bd5595ab Mon Sep 17 00:00:00 2001 From: zautrix Date: Sun, 10 Jul 2005 18:45:37 +0000 Subject: rec agenda fix --- (limited to 'korganizer/koagendaview.cpp') diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 131a345..a01323a 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp @@ -1174,6 +1174,7 @@ void KOAgendaView::fillAgenda() DateList::ConstIterator dit; int curCol = 0; + int maxCol = mSelectedDates.count()-1; for( dit = mSelectedDates.begin(); dit != mSelectedDates.end(); ++dit ) { QDate currentDate = *dit; // kdDebug() << "KOAgendaView::fillAgenda(): " << currentDate.toString() @@ -1186,6 +1187,7 @@ void KOAgendaView::fillAgenda() mMaxY[curCol] = mAgenda->timeToY(QTime(0,0)) - 1; unsigned int numEvent; + //qDebug("+++++NUMEVENT %d", dayEvents.count()); for(numEvent=0;numEventmShowSyncEvents && event->uid().left(2) == QString("la") ) @@ -1207,12 +1209,25 @@ void KOAgendaView::fillAgenda() beginX = curCol; mAllDayAgenda->insertAllDayItem(event,currentDate,beginX,endX); } else { - //qDebug("days %d %s",endX , currentDate.toString().latin1()); - QDate dateit = currentDate.addDays( -endX ); - if ( event->recursOn( dateit ) ) { - //qDebug("found %d %d %d %s", endX,curCol, curCol-endX ,dateit.toString().latin1() ); - if ( curCol-endX < 0 ) { + //qDebug("days endX %d curCol %d max Col %d %s",endX ,curCol, maxCol, currentDate.toString().latin1()); + if ( curCol == maxCol && maxCol+1 < endX ) { + int i; + for ( i = 1; i< endX; ++i ) { + if ( event->recursOn( currentDate.addDays( -i ) ) ) + break; + } + if ( i > maxCol ) { mAllDayAgenda->insertAllDayItem(event,currentDate,0,curCol); + //qDebug("BINGO "); + } + + } else { + QDate dateit = currentDate.addDays( -endX ); + if ( event->recursOn( dateit ) ) { + //qDebug("found %d %d %d %s", endX,curCol, curCol-endX ,dateit.toString().latin1() ); + if ( curCol-endX < 0 ) { + mAllDayAgenda->insertAllDayItem(event,currentDate,0,curCol); + } } } } -- cgit v0.9.0.2