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.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 4ff6899..db66413 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -996,26 +996,20 @@ void KOAgendaView::updateEventDates(KOAgendaItem *item, int type)
}
}
if ( item->incidence()->type() == "Event" ) {
item->incidence()->setDtStart(startDt);
(static_cast<Event*>(item->incidence()))->setDtEnd(endDt);
} else if ( item->incidence()->type() == "Todo" ) {
Todo* to = static_cast<Todo*>(item->incidence());
- int len = 0;
- if ( to->hasStartDate() && to->hasDueDate() )
- len = to->dtStart().secsTo( to->dtDue());
to->setDtDue(endDt);
if ( to->hasStartDate() ) {
- if ( len>0 )
- to->setDtStart(to->dtDue().addSecs( -len ));
- else
- if (to->dtStart() > to->dtDue() )
- to->setDtStart(to->dtDue().addDays( -3 ));
+ if (to->dtStart() >= to->dtDue() )
+ to->setDtStart(to->dtDue().addDays( -2 ));
}
}
//qDebug("KOAgendaView::updateEventDates stsart %s end %s ", startDt.toString().latin1(), endDt.toString().latin1() );
item->incidence()->setRevision(item->incidence()->revision()+1);
item->setItemDate(startDt.date());
//item->updateItem();
if ( item->incidence()->type() == "Todo" ) {