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) (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
@@ -1415,13 +1415,13 @@ KOAgendaItem * KOAgenda::getItemForTodo ( Todo * todo )
return 0;
}
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);
if ( item ) {
blockSignals( true );
//qDebug("item found ");
@@ -1454,18 +1454,23 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove)
//qDebug("remove****************************************** ");
return;
}
//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;
// aldayagenda
globalFlagBlockAgendaItemPaint = 1;
item = insertAllDayItem(todo, currentDate,days, days);
@@ -1473,13 +1478,13 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove)
}
else {
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);
item->show();
}
qApp->processEvents();