summaryrefslogtreecommitdiffabout
path: root/korganizer/koagendaview.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/koagendaview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaview.cpp33
1 files changed, 22 insertions, 11 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 1864e22..bbc43e4 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -950,6 +950,7 @@ void KOAgendaView::updateEventDates(KOAgendaItem *item, int type)
}
} else {
// todo
+ qDebug("tooooodoooooo ");
if (item->lastMultiItem()) {
endDt.setTime(mAgenda->gyToTime(item->lastMultiItem()->cellYBottom()+1));
endDt.setDate(startDate.
@@ -965,7 +966,7 @@ void KOAgendaView::updateEventDates(KOAgendaItem *item, int type)
}
}
-
+ qDebug("to888");
if ( item->incidence()->type() == "Event" ) {
item->incidence()->setDtStart(startDt);
(static_cast<Event*>(item->incidence()))->setDtEnd(endDt);
@@ -1055,7 +1056,7 @@ void KOAgendaView::fillAgenda()
QPtrList<Event> dayEvents;
// ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue.
- // Therefore, get all of them.
+ // Therefore, gtodoset all of them.
QPtrList<Todo> todos = calendar()->todos();
mAgenda->setDateList(mSelectedDates);
@@ -1155,9 +1156,13 @@ void KOAgendaView::fillAgenda()
// Already completed items can be displayed on their original due date
//if not KOPrefs::instance()->mShowTodoInAgenda, show overdue in agenda
bool overdue = (!todo->isCompleted()) && (todo->dtDue() < today) && KOPrefs::instance()->mShowTodoInAgenda;
-
- if ( ((todo->dtDue().date() == currentDate) && !overdue) || ( todo->hasCompletedDate() && todo->completed().date() == currentDate )||
- ((currentDate == today) && overdue) ) {
+ bool fillIn = false;
+ if ( todo->hasCompletedDate() && todo->completed().date() == currentDate )
+ fillIn = true;
+ if ( ! fillIn && !todo->hasCompletedDate() )
+ fillIn = ((todo->dtDue().date() == currentDate) && !overdue) || ((currentDate == today) && overdue);
+ qDebug("refill todo ");
+ if ( fillIn ) {
if ( (todo->doesFloat() || overdue ) && !todo->hasCompletedDate() ) { // Todo has no due-time set or is already overdue
if ( KOPrefs::instance()->mShowTodoInAgenda )
mAllDayAgenda->insertAllDayItem(todo, currentDate, curCol, curCol);
@@ -1503,10 +1508,15 @@ void KOAgendaView::setStartHour( int h )
void KOAgendaView::updateTodo( Todo * t, int )
{
-
+
bool remove = false;
bool removeAD = false;
- if ( ! t->hasDueDate() ) {
+ QDate da;
+ if ( t->hasCompletedDate() )
+ da = t->completed().date();
+ else
+ da = t->dtDue().date();
+ if ( ! t->hasDueDate() && !t->hasCompletedDate() ) {
remove = true;
removeAD = true;
}
@@ -1519,17 +1529,18 @@ void KOAgendaView::updateTodo( Todo * t, int )
remove = true;
}
else {
- if ( t->dtDue().date() < mSelectedDates.first() ||
- t->dtDue().date() > mSelectedDates.last() ) {
+
+ if ( da < mSelectedDates.first() ||
+ da > mSelectedDates.last() ) {
remove = true;
removeAD = true;
} else {
- remove = t->doesFloat();
+ remove = t->doesFloat() && !t->hasCompletedDate();
removeAD = !remove;
}
}
}
- int days = mSelectedDates.first().daysTo( t->dtDue().date() );
+ int days = mSelectedDates.first().daysTo( da );
// qDebug("daysto %d ", days );
mAgenda->updateTodo( t , days, remove);
if ( KOPrefs::instance()->mShowTodoInAgenda )