summaryrefslogtreecommitdiffabout
path: root/korganizer/koagendaview.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/koagendaview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koagendaview.cpp31
1 files changed, 21 insertions, 10 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 1864e22..bbc43e4 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -951,4 +951,5 @@ void KOAgendaView::updateEventDates(KOAgendaItem *item, int type)
} else {
// todo
+ qDebug("tooooodoooooo ");
if (item->lastMultiItem()) {
endDt.setTime(mAgenda->gyToTime(item->lastMultiItem()->cellYBottom()+1));
@@ -966,5 +967,5 @@ void KOAgendaView::updateEventDates(KOAgendaItem *item, int type)
}
-
+ qDebug("to888");
if ( item->incidence()->type() == "Event" ) {
item->incidence()->setDtStart(startDt);
@@ -1056,5 +1057,5 @@ void KOAgendaView::fillAgenda()
// 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();
@@ -1156,7 +1157,11 @@ void KOAgendaView::fillAgenda()
//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 )
@@ -1507,5 +1512,10 @@ 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;
@@ -1520,15 +1530,16 @@ void KOAgendaView::updateTodo( Todo * t, int )
}
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);