summaryrefslogtreecommitdiffabout
path: root/korganizer/koagendaview.cpp
Unidiff
Diffstat (limited to 'korganizer/koagendaview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaview.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 13d8398..4ff6899 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -999,7 +999,20 @@ void KOAgendaView::updateEventDates(KOAgendaItem *item, int type)
999 item->incidence()->setDtStart(startDt); 999 item->incidence()->setDtStart(startDt);
1000 (static_cast<Event*>(item->incidence()))->setDtEnd(endDt); 1000 (static_cast<Event*>(item->incidence()))->setDtEnd(endDt);
1001 } else if ( item->incidence()->type() == "Todo" ) { 1001 } else if ( item->incidence()->type() == "Todo" ) {
1002 (static_cast<Todo*>(item->incidence()))->setDtDue(endDt); 1002 Todo* to = static_cast<Todo*>(item->incidence());
1003
1004 int len = 0;
1005 if ( to->hasStartDate() && to->hasDueDate() )
1006 len = to->dtStart().secsTo( to->dtDue());
1007 to->setDtDue(endDt);
1008 if ( to->hasStartDate() ) {
1009 if ( len>0 )
1010 to->setDtStart(to->dtDue().addSecs( -len ));
1011 else
1012 if (to->dtStart() > to->dtDue() )
1013 to->setDtStart(to->dtDue().addDays( -3 ));
1014 }
1015
1003 } 1016 }
1004 //qDebug("KOAgendaView::updateEventDates stsart %s end %s ", startDt.toString().latin1(), endDt.toString().latin1() ); 1017 //qDebug("KOAgendaView::updateEventDates stsart %s end %s ", startDt.toString().latin1(), endDt.toString().latin1() );
1005 item->incidence()->setRevision(item->incidence()->revision()+1); 1018 item->incidence()->setRevision(item->incidence()->revision()+1);
@@ -1180,7 +1193,7 @@ void KOAgendaView::fillAgenda()
1180 Todo *todo = todos.at(numTodo); 1193 Todo *todo = todos.at(numTodo);
1181 1194
1182 if ( ! todo->hasDueDate() && !todo->hasCompletedDate()) continue; // todo shall not be displayed if it has no date 1195 if ( ! todo->hasDueDate() && !todo->hasCompletedDate()) continue; // todo shall not be displayed if it has no date
1183 1196
1184 // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue. 1197 // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue.
1185 // Already completed items can be displayed on their original due date 1198 // Already completed items can be displayed on their original due date
1186 //if not KOPrefs::instance()->mShowTodoInAgenda, show overdue in agenda 1199 //if not KOPrefs::instance()->mShowTodoInAgenda, show overdue in agenda