summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagenda.cpp11
-rw-r--r--korganizer/koagendaview.cpp33
-rw-r--r--korganizer/koeventviewer.cpp18
-rw-r--r--korganizer/kotodoview.cpp13
-rw-r--r--korganizer/kotodoviewitem.cpp7
5 files changed, 54 insertions, 28 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index 002234d..7c41cab 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -1420,3 +1420,3 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove)
1420{ 1420{
1421 1421 // ( todo->hasCompletedDate() && todo->completed().date() == currentDate )||
1422 KOAgendaItem *item; 1422 KOAgendaItem *item;
@@ -1459,2 +1459,7 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove)
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 ) {
@@ -1464,3 +1469,3 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove)
1464 else 1469 else
1465 currentDate = todo->dtDue().date(); 1470 currentDate = dt.date();
1466 1471
@@ -1478,3 +1483,3 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove)
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;
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 1864e22..bbc43e4 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -952,2 +952,3 @@ void KOAgendaView::updateEventDates(KOAgendaItem *item, int type)
952 // todo 952 // todo
953 qDebug("tooooodoooooo ");
953 if (item->lastMultiItem()) { 954 if (item->lastMultiItem()) {
@@ -967,3 +968,3 @@ void KOAgendaView::updateEventDates(KOAgendaItem *item, int type)
967 968
968 969 qDebug("to888");
969 if ( item->incidence()->type() == "Event" ) { 970 if ( item->incidence()->type() == "Event" ) {
@@ -1057,3 +1058,3 @@ void KOAgendaView::fillAgenda()
1057 // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue. 1058 // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue.
1058 // Therefore, get all of them. 1059 // Therefore, gtodoset all of them.
1059 QPtrList<Todo> todos = calendar()->todos(); 1060 QPtrList<Todo> todos = calendar()->todos();
@@ -1157,5 +1158,9 @@ void KOAgendaView::fillAgenda()
1157 bool overdue = (!todo->isCompleted()) && (todo->dtDue() < today) && KOPrefs::instance()->mShowTodoInAgenda; 1158 bool overdue = (!todo->isCompleted()) && (todo->dtDue() < today) && KOPrefs::instance()->mShowTodoInAgenda;
1158 1159 bool fillIn = false;
1159 if ( ((todo->dtDue().date() == currentDate) && !overdue) || ( todo->hasCompletedDate() && todo->completed().date() == currentDate )|| 1160 if ( todo->hasCompletedDate() && todo->completed().date() == currentDate )
1160 ((currentDate == today) && overdue) ) { 1161 fillIn = true;
1162 if ( ! fillIn && !todo->hasCompletedDate() )
1163 fillIn = ((todo->dtDue().date() == currentDate) && !overdue) || ((currentDate == today) && overdue);
1164 qDebug("refill todo ");
1165 if ( fillIn ) {
1161 if ( (todo->doesFloat() || overdue ) && !todo->hasCompletedDate() ) { // Todo has no due-time set or is already overdue 1166 if ( (todo->doesFloat() || overdue ) && !todo->hasCompletedDate() ) { // Todo has no due-time set or is already overdue
@@ -1505,6 +1510,11 @@ void KOAgendaView::updateTodo( Todo * t, int )
1505{ 1510{
1506 1511
1507 bool remove = false; 1512 bool remove = false;
1508 bool removeAD = false; 1513 bool removeAD = false;
1509 if ( ! t->hasDueDate() ) { 1514 QDate da;
1515 if ( t->hasCompletedDate() )
1516 da = t->completed().date();
1517 else
1518 da = t->dtDue().date();
1519 if ( ! t->hasDueDate() && !t->hasCompletedDate() ) {
1510 remove = true; 1520 remove = true;
@@ -1521,4 +1531,5 @@ void KOAgendaView::updateTodo( Todo * t, int )
1521 else { 1531 else {
1522 if ( t->dtDue().date() < mSelectedDates.first() || 1532
1523 t->dtDue().date() > mSelectedDates.last() ) { 1533 if ( da < mSelectedDates.first() ||
1534 da > mSelectedDates.last() ) {
1524 remove = true; 1535 remove = true;
@@ -1526,3 +1537,3 @@ void KOAgendaView::updateTodo( Todo * t, int )
1526 } else { 1537 } else {
1527 remove = t->doesFloat(); 1538 remove = t->doesFloat() && !t->hasCompletedDate();
1528 removeAD = !remove; 1539 removeAD = !remove;
@@ -1531,3 +1542,3 @@ void KOAgendaView::updateTodo( Todo * t, int )
1531 } 1542 }
1532 int days = mSelectedDates.first().daysTo( t->dtDue().date() ); 1543 int days = mSelectedDates.first().daysTo( da );
1533 // qDebug("daysto %d ", days ); 1544 // qDebug("daysto %d ", days );
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index 36a2947..7dc1880 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -349,2 +349,12 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
349 mMailSubject += i18n( "Todo " )+ event->summary(); 349 mMailSubject += i18n( "Todo " )+ event->summary();
350
351 if ( event->percentComplete() == 100 && event->hasCompletedDate() ) {
352 mText +="<font color=\"#B00000\">";
353 addTag("i", i18n("<p><i>Completed on %1</i></p>").arg( event->completedStr(KOPrefs::instance()->mShortDateInViewer) ) );
354 mText += "</font>";
355 } else {
356 mText.append(i18n("<p><i>%1 % completed</i></p>")
357 .arg(event->percentComplete()));
358 }
359
350 if (event->cancelled ()) { 360 if (event->cancelled ()) {
@@ -381,10 +391,2 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
381 391
382 if ( event->percentComplete() == 100 && event->hasCompletedDate() ) {
383 mText.append(i18n("<p><i>Completed on %1</i></p>")
384 .arg( event->completedStr() ));
385 } else {
386 mText.append(i18n("<p><i>%1 % completed</i></p>")
387 .arg(event->percentComplete()));
388 }
389
390 formatReadOnly(event); 392 formatReadOnly(event);
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 8c1953d..14e8b5c 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -336,2 +336,3 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
336{ 336{
337 isFlatDisplay = false;
337 mNavigator = 0; 338 mNavigator = 0;
@@ -954,6 +955,11 @@ void KOTodoView::itemClicked(QListViewItem *item)
954 } 955 }
955 int completed = todoItem->todo()->isCompleted(); // Completed or not? 956#if 0
956 957 // handled by the item itself
958 bool completed = todoItem->todo()->isCompleted(); // Completed or not?
959 qDebug("com %d ",completed );
960 qDebug("itemclicked ");
957 if (todoItem->isOn()) { 961 if (todoItem->isOn()) {
962 qDebug("on ");
958 if (!completed) { 963 if (!completed) {
964 qDebug("set true ");
959 todoItem->todo()->setCompleted(QDateTime::currentDateTime()); 965 todoItem->todo()->setCompleted(QDateTime::currentDateTime());
@@ -961,3 +967,5 @@ void KOTodoView::itemClicked(QListViewItem *item)
961 } else { 967 } else {
968 qDebug("not on ");
962 if (completed) { 969 if (completed) {
970 qDebug("set false ");
963 todoItem->todo()->setCompleted(false); 971 todoItem->todo()->setCompleted(false);
@@ -965,2 +973,3 @@ void KOTodoView::itemClicked(QListViewItem *item)
965 } 973 }
974#endif
966} 975}
diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp
index 21ecb73..2822237 100644
--- a/korganizer/kotodoviewitem.cpp
+++ b/korganizer/kotodoviewitem.cpp
@@ -205,4 +205,3 @@ void KOTodoViewItem::stateChange(bool state)
205 if ( m_init ) return; 205 if ( m_init ) return;
206 206 qDebug("KOTodoViewItem::stateChange ");
207 kdDebug() << "State changed, modified " << state << endl;
208 QString keyd = "=="; 207 QString keyd = "==";
@@ -210,4 +209,4 @@ void KOTodoViewItem::stateChange(bool state)
210 209
211 if (state) mTodo->setCompleted(state); 210 mTodo->setCompleted(state);
212 else mTodo->setPercentComplete(0); 211 if (state) mTodo->setCompleted(QDateTime::currentDateTime());
213 if (isOn()!=state) { 212 if (isOn()!=state) {