summaryrefslogtreecommitdiffabout
path: root/korganizer/koagendaview.cpp
authorzautrix <zautrix>2005-01-30 10:57:34 (UTC)
committer zautrix <zautrix>2005-01-30 10:57:34 (UTC)
commit446ea98a9f6550c4a3e64bcfc6aab8e8b58776e8 (patch) (side-by-side diff)
tree26260551e87a4074651a5cdceee5e788f743a02d /korganizer/koagendaview.cpp
parent949c6e28c83668176fd9c29e12668322c6ae627f (diff)
downloadkdepimpi-446ea98a9f6550c4a3e64bcfc6aab8e8b58776e8.zip
kdepimpi-446ea98a9f6550c4a3e64bcfc6aab8e8b58776e8.tar.gz
kdepimpi-446ea98a9f6550c4a3e64bcfc6aab8e8b58776e8.tar.bz2
bugs from last commit fixed
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 )