summaryrefslogtreecommitdiffabout
path: root/korganizer/koagenda.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/koagenda.cpp
parent949c6e28c83668176fd9c29e12668322c6ae627f (diff)
downloadkdepimpi-446ea98a9f6550c4a3e64bcfc6aab8e8b58776e8.zip
kdepimpi-446ea98a9f6550c4a3e64bcfc6aab8e8b58776e8.tar.gz
kdepimpi-446ea98a9f6550c4a3e64bcfc6aab8e8b58776e8.tar.bz2
bugs from last commit fixed
Diffstat (limited to 'korganizer/koagenda.cpp') (more/less context) (show 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 )
void KOAgenda::updateTodo( Todo * todo, int days, bool remove)
{
-
+ // ( todo->hasCompletedDate() && todo->completed().date() == currentDate )||
KOAgendaItem *item;
item = getItemForTodo ( todo );
//qDebug("KOAgenda::updateTodo %d %d %d %d", this, todo, days, remove);
@@ -1457,12 +1457,17 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove)
//qDebug("updateTodo+++++++++++++++++++++++++++++++++++++ ");
bool overdue = (!todo->isCompleted()) && (todo->dtDue() < QDate::currentDate())&& ( KOPrefs::instance()->mShowTodoInAgenda );
QDate currentDate;
+ QDateTime dt;
+ if ( todo->hasCompletedDate() )
+ dt = todo->completed();
+ else
+ dt = todo->dtDue();
if ( overdue ) {
currentDate = QDate::currentDate();
days += todo->dtDue().date().daysTo( currentDate );
}
else
- currentDate = todo->dtDue().date();
+ currentDate = dt.date();
if ( todo->doesFloat() || overdue ) {
if ( ! mAllDayMode ) return;
@@ -1476,7 +1481,7 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove)
if ( mAllDayMode ) return;
// mAgenda
globalFlagBlockAgendaItemPaint = 1;
- int endY = timeToY(todo->dtDue().time()) - 1;
+ int endY = timeToY(dt.time()) - 1;
int hi = 12/KOPrefs::instance()->mHourSize;
int startY = endY - 1-hi;
item = insertItem(todo,currentDate,days,startY,endY);