author | zautrix <zautrix> | 2005-07-10 18:45:37 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-10 18:45:37 (UTC) |
commit | b3b9d2e1b0435cd8943922759c8091d2bd5595ab (patch) (side-by-side diff) | |
tree | 7fd43053310d964e1f8260b0c43c7ec6f0f74464 | |
parent | d6fdd08218996b5dc528eecd0b2170a4afce877d (diff) | |
download | kdepimpi-b3b9d2e1b0435cd8943922759c8091d2bd5595ab.zip kdepimpi-b3b9d2e1b0435cd8943922759c8091d2bd5595ab.tar.gz kdepimpi-b3b9d2e1b0435cd8943922759c8091d2bd5595ab.tar.bz2 |
rec agenda fix
-rw-r--r-- | korganizer/koagendaview.cpp | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 131a345..a01323a 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp @@ -1161,71 +1161,86 @@ void KOAgendaView::fillAgenda() mMinY.resize(mSelectedDates.count()); mMaxY.resize(mSelectedDates.count()); QPtrList<Event> dayEvents; // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue. // Therefore, gtodoset all of them. QPtrList<Todo> todos = calendar()->todos(); mAgenda->setDateList(mSelectedDates); QDate today = QDate::currentDate(); 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() // << endl; dayEvents = calendar()->events(currentDate,false); // Default values, which can never be reached mMinY[curCol] = mAgenda->timeToY(QTime(23,59)) + 1; mMaxY[curCol] = mAgenda->timeToY(QTime(0,0)) - 1; unsigned int numEvent; + //qDebug("+++++NUMEVENT %d", dayEvents.count()); for(numEvent=0;numEvent<dayEvents.count();++numEvent) { Event *event = dayEvents.at(numEvent); if ( !KOPrefs::instance()->mShowSyncEvents && event->uid().left(2) == QString("la") ) if ( event->uid().left(15) == QString("last-syncEvent-") ) continue; // kdDebug() << " Event: " << event->summary() << endl; int beginX = currentDate.daysTo(event->dtStart().date()) + curCol; int endX = currentDate.daysTo(event->dtEnd().date()) + curCol; // kdDebug() << " beginX: " << beginX << " endX: " << endX << endl; if (event->doesFloat()) { if (event->recurrence()->doesRecur()) { if (event->isMultiDay() ) { endX = endX - beginX;// endX is now number of days if ( event->recursOn( currentDate ) ) { endX += curCol; 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); + } } } } } else { mAllDayAgenda->insertAllDayItem(event,currentDate,curCol,curCol); } } else { if (beginX <= 0 && curCol == 0) { mAllDayAgenda->insertAllDayItem(event,currentDate,beginX,endX); } else if (beginX == curCol) { mAllDayAgenda->insertAllDayItem(event,currentDate,beginX,endX); } } } else if (event->isMultiDay()) { if ( event->doesRecur () ) { |