summaryrefslogtreecommitdiffabout
path: root/korganizer/koagenda.cpp
Unidiff
Diffstat (limited to 'korganizer/koagenda.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagenda.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index 002234d..7c41cab 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -1418,7 +1418,7 @@ KOAgendaItem * KOAgenda::getItemForTodo ( Todo * todo )
1418 1418
1419void KOAgenda::updateTodo( Todo * todo, int days, bool remove) 1419void KOAgenda::updateTodo( Todo * todo, int days, bool remove)
1420{ 1420{
1421 1421 // ( todo->hasCompletedDate() && todo->completed().date() == currentDate )||
1422 KOAgendaItem *item; 1422 KOAgendaItem *item;
1423 item = getItemForTodo ( todo ); 1423 item = getItemForTodo ( todo );
1424 //qDebug("KOAgenda::updateTodo %d %d %d %d", this, todo, days, remove); 1424 //qDebug("KOAgenda::updateTodo %d %d %d %d", this, todo, days, remove);
@@ -1457,12 +1457,17 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove)
1457 //qDebug("updateTodo+++++++++++++++++++++++++++++++++++++ "); 1457 //qDebug("updateTodo+++++++++++++++++++++++++++++++++++++ ");
1458 bool overdue = (!todo->isCompleted()) && (todo->dtDue() < QDate::currentDate())&& ( KOPrefs::instance()->mShowTodoInAgenda ); 1458 bool overdue = (!todo->isCompleted()) && (todo->dtDue() < QDate::currentDate())&& ( KOPrefs::instance()->mShowTodoInAgenda );
1459 QDate currentDate; 1459 QDate currentDate;
1460 QDateTime dt;
1461 if ( todo->hasCompletedDate() )
1462 dt = todo->completed();
1463 else
1464 dt = todo->dtDue();
1460 if ( overdue ) { 1465 if ( overdue ) {
1461 currentDate = QDate::currentDate(); 1466 currentDate = QDate::currentDate();
1462 days += todo->dtDue().date().daysTo( currentDate ); 1467 days += todo->dtDue().date().daysTo( currentDate );
1463 } 1468 }
1464 else 1469 else
1465 currentDate = todo->dtDue().date(); 1470 currentDate = dt.date();
1466 1471
1467 if ( todo->doesFloat() || overdue ) { 1472 if ( todo->doesFloat() || overdue ) {
1468 if ( ! mAllDayMode ) return; 1473 if ( ! mAllDayMode ) return;
@@ -1476,7 +1481,7 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove)
1476 if ( mAllDayMode ) return; 1481 if ( mAllDayMode ) return;
1477 // mAgenda 1482 // mAgenda
1478 globalFlagBlockAgendaItemPaint = 1; 1483 globalFlagBlockAgendaItemPaint = 1;
1479 int endY = timeToY(todo->dtDue().time()) - 1; 1484 int endY = timeToY(dt.time()) - 1;
1480 int hi = 12/KOPrefs::instance()->mHourSize; 1485 int hi = 12/KOPrefs::instance()->mHourSize;
1481 int startY = endY - 1-hi; 1486 int startY = endY - 1-hi;
1482 item = insertItem(todo,currentDate,days,startY,endY); 1487 item = insertItem(todo,currentDate,days,startY,endY);