summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt4
-rw-r--r--korganizer/calendarview.cpp14
-rw-r--r--korganizer/koagendaview.cpp15
-rw-r--r--korganizer/koeventviewer.cpp7
-rw-r--r--korganizer/kolistview.cpp2
-rw-r--r--korganizer/komonthview.cpp3
-rw-r--r--korganizer/kowhatsnextview.cpp6
-rw-r--r--libkcal/icalformatimpl.cpp2
-rw-r--r--libkcal/incidence.cpp8
-rw-r--r--libkcal/kincidenceformatter.cpp12
-rw-r--r--libkcal/todo.cpp4
11 files changed, 69 insertions, 8 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt
index c85ca35..2d4cb74 100644
--- a/bin/kdepim/korganizer/germantranslation.txt
+++ b/bin/kdepim/korganizer/germantranslation.txt
@@ -1260,25 +1260,25 @@
1260{ "Data saved to temp file!","Daten in temp Datei gespeichert!" }, 1260{ "Data saved to temp file!","Daten in temp Datei gespeichert!" },
1261{ "Sending file...","Sende Datei..." }, 1261{ "Sending file...","Sende Datei..." },
1262{ "Waiting for synced file...","Warte auf gesyncte Daten..." }, 1262{ "Waiting for synced file...","Warte auf gesyncte Daten..." },
1263{ "Receiving synced file...","Gesyncte Daten erhalten..." }, 1263{ "Receiving synced file...","Gesyncte Daten erhalten..." },
1264{ "Received %1 bytes","%1 Bytes erhalten" }, 1264{ "Received %1 bytes","%1 Bytes erhalten" },
1265{ "Writing file to disk...","Speichere Datei..." }, 1265{ "Writing file to disk...","Speichere Datei..." },
1266{ "Pi-Sync successful!","Pi-Sync erfolgreich!" }, 1266{ "Pi-Sync successful!","Pi-Sync erfolgreich!" },
1267{ "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, 1267{ "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" },
1268{ "Synchronize!","Synchronisiere!" }, 1268{ "Synchronize!","Synchronisiere!" },
1269{ "High clock skew!","Großer Uhrzeitunterschied!" }, 1269{ "High clock skew!","Großer Uhrzeitunterschied!" },
1270{ "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, 1270{ "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" },
1271{ "The clocks of the syncing\ndevices have a difference\nof more than 5 minutes.\nPlease adjust your clocks.\nYou may get wrong syncing results!\nPlease confirm synchronization!","Die Uhren der syncenden Geräte\nhaben einen Unterschied von\nmehr als 5 Minuten. Bitte die\nUhrzeiten anpassen. Sie können\nfalsche Sync-Resultate erhalten!\nBitte das Syncen bestätigen!" }, 1271{ "The clocks of the syncing\ndevices have a difference\nof more than 5 minutes.\nPlease adjust your clocks.\nYou may get wrong syncing results!\nPlease confirm synchronization!","Die Uhren der syncenden Geräte\nhaben einen Unterschied von\nmehr als 5 Minuten. Bitte die\nUhrzeiten anpassen. Sie können\nfalsche Sync-Resultate erhalten!\nBitte das Syncen bestätigen!" },
1272{ "","" }, 1272{ "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." },
1273{ "","" }, 1273{ "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" },
1274{ "","" }, 1274{ "","" },
1275{ "","" }, 1275{ "","" },
1276{ "","" }, 1276{ "","" },
1277{ "","" }, 1277{ "","" },
1278{ "","" }, 1278{ "","" },
1279{ "","" }, 1279{ "","" },
1280{ "","" }, 1280{ "","" },
1281{ "","" }, 1281{ "","" },
1282{ "","" }, 1282{ "","" },
1283{ "","" }, 1283{ "","" },
1284{ "","" }, \ No newline at end of file 1284{ "","" }, \ No newline at end of file
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 7c8316f..3dac20b 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -2254,33 +2254,45 @@ void CalendarView::edit_options()
2254} 2254}
2255 2255
2256 2256
2257void CalendarView::slotSelectPickerDate( QDate d) 2257void CalendarView::slotSelectPickerDate( QDate d)
2258{ 2258{
2259 mDateFrame->hide(); 2259 mDateFrame->hide();
2260 if ( mDatePickerMode == 1 ) { 2260 if ( mDatePickerMode == 1 ) {
2261 mNavigator->slotDaySelect( d ); 2261 mNavigator->slotDaySelect( d );
2262 } else if ( mDatePickerMode == 2 ) { 2262 } else if ( mDatePickerMode == 2 ) {
2263 if ( mMoveIncidence->type() == "Todo" ) { 2263 if ( mMoveIncidence->type() == "Todo" ) {
2264 Todo * to = (Todo *) mMoveIncidence; 2264 Todo * to = (Todo *) mMoveIncidence;
2265 QTime tim; 2265 QTime tim;
2266 int len = 0;
2267 if ( to->hasStartDate() && to->hasDueDate() )
2268 len = to->dtStart().secsTo( to->dtDue());
2266 if ( to->hasDueDate() ) 2269 if ( to->hasDueDate() )
2267 tim = to->dtDue().time(); 2270 tim = to->dtDue().time();
2268 else { 2271 else {
2269 tim = QTime ( 0,0,0 ); 2272 tim = QTime ( 0,0,0 );
2270 to->setFloats( true ); 2273 to->setFloats( true );
2271 to->setHasDueDate( true ); 2274 to->setHasDueDate( true );
2272 } 2275 }
2273 QDateTime dt ( d,tim ); 2276 QDateTime dt ( d,tim );
2274 to->setDtDue( dt ); 2277 to->setDtDue( dt );
2278
2279 if ( to->hasStartDate() ) {
2280 if ( len>0 )
2281 to->setDtStart(to->dtDue().addSecs( -len ));
2282 else
2283 if (to->dtStart() > to->dtDue() )
2284 to->setDtStart(to->dtDue().addDays( -3 ));
2285 }
2286
2275 todoChanged( to ); 2287 todoChanged( to );
2276 } else { 2288 } else {
2277 if ( mMoveIncidence->doesRecur() ) { 2289 if ( mMoveIncidence->doesRecur() ) {
2278#if 0 2290#if 0
2279 // PENDING implement this 2291 // PENDING implement this
2280 Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate ); 2292 Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate );
2281 mCalendar()->addIncidence( newInc ); 2293 mCalendar()->addIncidence( newInc );
2282 if ( mMoveIncidence->type() == "Todo" ) 2294 if ( mMoveIncidence->type() == "Todo" )
2283 emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED ); 2295 emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED );
2284 else 2296 else
2285 emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED); 2297 emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED);
2286 mMoveIncidence = newInc; 2298 mMoveIncidence = newInc;
@@ -3801,25 +3813,25 @@ void CalendarView::lookForIncomingMessages()
3801 3813
3802bool CalendarView::removeCompletedSubTodos( Todo* t ) 3814bool CalendarView::removeCompletedSubTodos( Todo* t )
3803{ 3815{
3804 bool deleteTodo = true; 3816 bool deleteTodo = true;
3805 QPtrList<Incidence> subTodos; 3817 QPtrList<Incidence> subTodos;
3806 Incidence *aTodo; 3818 Incidence *aTodo;
3807 subTodos = t->relations(); 3819 subTodos = t->relations();
3808 for (aTodo = subTodos.first(); aTodo; aTodo = subTodos.next()) { 3820 for (aTodo = subTodos.first(); aTodo; aTodo = subTodos.next()) {
3809 if (! removeCompletedSubTodos( (Todo*) aTodo )) 3821 if (! removeCompletedSubTodos( (Todo*) aTodo ))
3810 deleteTodo = false; 3822 deleteTodo = false;
3811 } 3823 }
3812 if ( deleteTodo ) { 3824 if ( deleteTodo ) {
3813 if ( t->isCompleted() ) { 3825 if ( t->isCompleted() && !t->doesRecur()) {
3814 checkExternalId( t ); 3826 checkExternalId( t );
3815 mCalendar->deleteTodo( t ); 3827 mCalendar->deleteTodo( t );
3816 changeTodoDisplay( t,KOGlobals::EVENTDELETED ); 3828 changeTodoDisplay( t,KOGlobals::EVENTDELETED );
3817 } 3829 }
3818 else 3830 else
3819 deleteTodo = false; 3831 deleteTodo = false;
3820 } 3832 }
3821 return deleteTodo; 3833 return deleteTodo;
3822 3834
3823} 3835}
3824void CalendarView::purgeCompleted() 3836void CalendarView::purgeCompleted()
3825{ 3837{
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 13d8398..4ff6899 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -990,25 +990,38 @@ void KOAgendaView::updateEventDates(KOAgendaItem *item, int type)
990 if ( item->cellYBottom() > 0 ) 990 if ( item->cellYBottom() > 0 )
991 endDt.setTime(mAgenda->gyToTime(item->cellYBottom()+1)); 991 endDt.setTime(mAgenda->gyToTime(item->cellYBottom()+1));
992 else 992 else
993 endDt.setTime((static_cast<Todo*>(item->incidence()))->dtDue().time()); 993 endDt.setTime((static_cast<Todo*>(item->incidence()))->dtDue().time());
994 endDt.setDate(startDate); 994 endDt.setDate(startDate);
995 } 995 }
996 } 996 }
997 } 997 }
998 if ( item->incidence()->type() == "Event" ) { 998 if ( item->incidence()->type() == "Event" ) {
999 item->incidence()->setDtStart(startDt); 999 item->incidence()->setDtStart(startDt);
1000 (static_cast<Event*>(item->incidence()))->setDtEnd(endDt); 1000 (static_cast<Event*>(item->incidence()))->setDtEnd(endDt);
1001 } else if ( item->incidence()->type() == "Todo" ) { 1001 } else if ( item->incidence()->type() == "Todo" ) {
1002 (static_cast<Todo*>(item->incidence()))->setDtDue(endDt); 1002 Todo* to = static_cast<Todo*>(item->incidence());
1003
1004 int len = 0;
1005 if ( to->hasStartDate() && to->hasDueDate() )
1006 len = to->dtStart().secsTo( to->dtDue());
1007 to->setDtDue(endDt);
1008 if ( to->hasStartDate() ) {
1009 if ( len>0 )
1010 to->setDtStart(to->dtDue().addSecs( -len ));
1011 else
1012 if (to->dtStart() > to->dtDue() )
1013 to->setDtStart(to->dtDue().addDays( -3 ));
1014 }
1015
1003 } 1016 }
1004 //qDebug("KOAgendaView::updateEventDates stsart %s end %s ", startDt.toString().latin1(), endDt.toString().latin1() ); 1017 //qDebug("KOAgendaView::updateEventDates stsart %s end %s ", startDt.toString().latin1(), endDt.toString().latin1() );
1005 item->incidence()->setRevision(item->incidence()->revision()+1); 1018 item->incidence()->setRevision(item->incidence()->revision()+1);
1006 item->setItemDate(startDt.date()); 1019 item->setItemDate(startDt.date());
1007 //item->updateItem(); 1020 //item->updateItem();
1008 if ( item->incidence()->type() == "Todo" ) { 1021 if ( item->incidence()->type() == "Todo" ) {
1009 emit todoMoved((Todo*)item->incidence(), KOGlobals::EVENTEDITED ); 1022 emit todoMoved((Todo*)item->incidence(), KOGlobals::EVENTEDITED );
1010 1023
1011 } 1024 }
1012 else 1025 else
1013 emit incidenceChanged(item->incidence(), KOGlobals::EVENTEDITED); 1026 emit incidenceChanged(item->incidence(), KOGlobals::EVENTEDITED);
1014 item->updateItem(); 1027 item->updateItem();
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index 39921a0..f6c9624 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -393,24 +393,31 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
393 mText +="<font color=\"#B00000\">"; 393 mText +="<font color=\"#B00000\">";
394 addTag("i",i18n("This todo has been cancelled!")); 394 addTag("i",i18n("This todo has been cancelled!"));
395 mText.append("<br>"); 395 mText.append("<br>");
396 mText += "</font>"; 396 mText += "</font>";
397 mMailSubject += i18n("(cancelled)"); 397 mMailSubject += i18n("(cancelled)");
398 } 398 }
399 399
400 if (!event->location().isEmpty()) { 400 if (!event->location().isEmpty()) {
401 addTag("b",i18n("Location: ")); 401 addTag("b",i18n("Location: "));
402 mText.append(event->location()+"<br>"); 402 mText.append(event->location()+"<br>");
403 mMailSubject += i18n(" at ") + event->location(); 403 mMailSubject += i18n(" at ") + event->location();
404 } 404 }
405
406 if (event->recurrence()->doesRecur()) {
407
408 QString recurText = event->recurrence()->recurrenceText();
409 addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>");
410
411 }
405 if (event->hasStartDate()) { 412 if (event->hasStartDate()) {
406 mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer))); 413 mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer)));
407 } 414 }
408 if (event->hasDueDate()) { 415 if (event->hasDueDate()) {
409 mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer))); 416 mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer)));
410 mMailSubject += i18n(" - " )+event->dtDueStr( true ); 417 mMailSubject += i18n(" - " )+event->dtDueStr( true );
411 } 418 }
412 addTag("b",i18n("Access: ")); 419 addTag("b",i18n("Access: "));
413 mText.append(event->secrecyStr()+"<br>"); 420 mText.append(event->secrecyStr()+"<br>");
414 if (!event->description().isEmpty()) { 421 if (!event->description().isEmpty()) {
415 addTag("p",i18n("<b>Details: </b>")); 422 addTag("p",i18n("<b>Details: </b>"));
416 addTag("p",event->description()); 423 addTag("p",event->description());
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index acd9265..d8e940b 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -147,25 +147,25 @@ bool ListItemVisitor::visit(Todo *t)
147 if (t->doesFloat()) { 147 if (t->doesFloat()) {
148 mItem->setText(2,"---"); 148 mItem->setText(2,"---");
149 } else { 149 } else {
150 mItem->setText(2,t->dtStartTimeStr()); 150 mItem->setText(2,t->dtStartTimeStr());
151 } 151 }
152 } else { 152 } else {
153 mItem->setText(1,"---"); 153 mItem->setText(1,"---");
154 mItem->setText(2,"---"); 154 mItem->setText(2,"---");
155 } 155 }
156 mItem->setText(3,"---"); 156 mItem->setText(3,"---");
157 mItem->setText(4,"---"); 157 mItem->setText(4,"---");
158 mItem->setText(5,t->isAlarmEnabled() ? i18n("Yes") : i18n("No")); 158 mItem->setText(5,t->isAlarmEnabled() ? i18n("Yes") : i18n("No"));
159 mItem->setText(6,"---"); 159 mItem->setText(6, t->recurrence()->recurrenceText());
160 if (t->hasDueDate()) { 160 if (t->hasDueDate()) {
161 mItem->setText(7,t->dtDueDateStr()); 161 mItem->setText(7,t->dtDueDateStr());
162 if (t->doesFloat()) { 162 if (t->doesFloat()) {
163 mItem->setText(8,"---"); 163 mItem->setText(8,"---");
164 } else { 164 } else {
165 mItem->setText(8,t->dtDueTimeStr()); 165 mItem->setText(8,t->dtDueTimeStr());
166 } 166 }
167 } else { 167 } else {
168 mItem->setText(7,"---"); 168 mItem->setText(7,"---");
169 mItem->setText(8,"---"); 169 mItem->setText(8,"---");
170 } 170 }
171 mItem->setText(9, t->cancelled() ? i18n("Yes") : i18n("No")); 171 mItem->setText(9, t->cancelled() ? i18n("Yes") : i18n("No"));
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index f595d35..d0380e3 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -572,24 +572,27 @@ void MonthViewCell::insertTodo(Todo *todo)
572 } else { 572 } else {
573 if (cat.isEmpty()) { 573 if (cat.isEmpty()) {
574 pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); 574 pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor);
575 } else { 575 } else {
576 pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); 576 pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat)));
577 } 577 }
578 } 578 }
579 579
580 } else { 580 } else {
581 pal = mStandardPalette ; 581 pal = mStandardPalette ;
582 } 582 }
583 item->setPalette( pal ); 583 item->setPalette( pal );
584 item->setRecur( todo->recurrence()->doesRecur() );
585 item->setAlarm( todo->isAlarmEnabled() );
586 item->setMoreInfo( todo->description().length() > 0 );
584 mItemList->insertItem( item ); 587 mItemList->insertItem( item );
585 mToolTip += text+"\n"; 588 mToolTip += text+"\n";
586} 589}
587void MonthViewCell::finishUpdateCell() 590void MonthViewCell::finishUpdateCell()
588{ 591{
589#ifdef DESKTOP_VERSION 592#ifdef DESKTOP_VERSION
590 if (mToolTip != "") 593 if (mToolTip != "")
591 QToolTip::add(this,mToolTip,toolTipGroup(),""); 594 QToolTip::add(this,mToolTip,toolTipGroup(),"");
592#endif 595#endif
593 mItemList->sort(); 596 mItemList->sort();
594 //setMyPalette(); 597 //setMyPalette();
595 setMyPalette(); 598 setMyPalette();
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp
index 391b3bb..18dc656 100644
--- a/korganizer/kowhatsnextview.cpp
+++ b/korganizer/kowhatsnextview.cpp
@@ -659,24 +659,30 @@ bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub )
659 mText +="["; 659 mText +="[";
660 mText += "a"; 660 mText += "a";
661 needClose =true; 661 needClose =true;
662 662
663 } 663 }
664 664
665 if ( ev->description().length() > 0 ) { 665 if ( ev->description().length() > 0 ) {
666 if ( !needClose) 666 if ( !needClose)
667 mText +="["; 667 mText +="[";
668 mText += "i"; 668 mText += "i";
669 needClose =true; 669 needClose =true;
670 } 670 }
671 if ( ev->doesRecur() ) {
672 if ( !needClose)
673 mText +="[";
674 mText += "r";
675 needClose =true;
676 }
671 // if ( ev->recurrence()->doesRecur() ) { 677 // if ( ev->recurrence()->doesRecur() ) {
672 // if ( !needClose) 678 // if ( !needClose)
673 // mText +="("; 679 // mText +="(";
674 // mText += "r"; 680 // mText += "r";
675 // needClose =true; 681 // needClose =true;
676 // } 682 // }
677 if ( needClose ) 683 if ( needClose )
678 mText += "] "; 684 mText += "] ";
679 if ( ev->cancelled() ) 685 if ( ev->cancelled() )
680 mText += "</font>"; 686 mText += "</font>";
681 mText += "<a href=\"todo:" + ev->uid() + "\">"; 687 mText += "<a href=\"todo:" + ev->uid() + "\">";
682 if ( ev->summary().length() > 0 ) 688 if ( ev->summary().length() > 0 )
diff --git a/libkcal/icalformatimpl.cpp b/libkcal/icalformatimpl.cpp
index bb9cb29..2e38ae3 100644
--- a/libkcal/icalformatimpl.cpp
+++ b/libkcal/icalformatimpl.cpp
@@ -1201,25 +1201,25 @@ void ICalFormatImpl::readIncidence(icalcomponent *parent,Incidence *incidence)
1201 incidence->setCancelled( true ); 1201 incidence->setCancelled( true );
1202 } 1202 }
1203 break; 1203 break;
1204 1204
1205 case ICAL_LOCATION_PROPERTY: // location 1205 case ICAL_LOCATION_PROPERTY: // location
1206 text = icalproperty_get_location(p); 1206 text = icalproperty_get_location(p);
1207 incidence->setLocation(QString::fromUtf8(text)); 1207 incidence->setLocation(QString::fromUtf8(text));
1208 break; 1208 break;
1209 1209
1210 case ICAL_RECURRENCEID_PROPERTY: 1210 case ICAL_RECURRENCEID_PROPERTY:
1211 icaltime = icalproperty_get_recurrenceid(p); 1211 icaltime = icalproperty_get_recurrenceid(p);
1212 incidence->setRecurrenceID( readICalDateTime(icaltime) ); 1212 incidence->setRecurrenceID( readICalDateTime(icaltime) );
1213 qDebug(" RecurrenceID %s",incidence->recurrenceID().toString().latin1() ); 1213 //qDebug(" RecurrenceID %s",incidence->recurrenceID().toString().latin1() );
1214 break; 1214 break;
1215#if 0 1215#if 0
1216 // status 1216 // status
1217 if ((vo = isAPropertyOf(vincidence, VCStatusProp)) != 0) { 1217 if ((vo = isAPropertyOf(vincidence, VCStatusProp)) != 0) {
1218 incidence->setStatus(s = fakeCString(vObjectUStringZValue(vo))); 1218 incidence->setStatus(s = fakeCString(vObjectUStringZValue(vo)));
1219 deleteStr(s); 1219 deleteStr(s);
1220 } 1220 }
1221 else 1221 else
1222 incidence->setStatus("NEEDS ACTION"); 1222 incidence->setStatus("NEEDS ACTION");
1223#endif 1223#endif
1224 1224
1225 case ICAL_PRIORITY_PROPERTY: // priority 1225 case ICAL_PRIORITY_PROPERTY: // priority
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp
index 0684af2..708ee6b 100644
--- a/libkcal/incidence.cpp
+++ b/libkcal/incidence.cpp
@@ -204,28 +204,36 @@ bool KCal::operator==( const Incidence& i1, const Incidence& i2 )
204 i1.priority() == i2.priority() && 204 i1.priority() == i2.priority() &&
205 i1.cancelled() == i2.cancelled() && 205 i1.cancelled() == i2.cancelled() &&
206 stringCompare( i1.location(), i2.location() ); 206 stringCompare( i1.location(), i2.location() );
207} 207}
208 208
209Incidence* Incidence::recreateCloneException( QDate d ) 209Incidence* Incidence::recreateCloneException( QDate d )
210{ 210{
211 Incidence* newInc = clone(); 211 Incidence* newInc = clone();
212 newInc->recreate(); 212 newInc->recreate();
213 if ( doesRecur() ) { 213 if ( doesRecur() ) {
214 addExDate( d ); 214 addExDate( d );
215 newInc->recurrence()->unsetRecurs(); 215 newInc->recurrence()->unsetRecurs();
216 if ( type() == "Event") {
216 int len = dtStart().secsTo( ((Event*)this)->dtEnd()); 217 int len = dtStart().secsTo( ((Event*)this)->dtEnd());
217 QTime tim = dtStart().time(); 218 QTime tim = dtStart().time();
218 newInc->setDtStart( QDateTime(d, tim) ); 219 newInc->setDtStart( QDateTime(d, tim) );
219 ((Event*)newInc)->setDtEnd( newInc->dtStart().addSecs( len ) ); 220 ((Event*)newInc)->setDtEnd( newInc->dtStart().addSecs( len ) );
221 } else {
222 int len = dtStart().secsTo( ((Todo*)this)->dtDue());
223 QTime tim = ((Todo*)this)->dtDue().time();
224 ((Todo*)newInc)->setDtDue( QDateTime(d, tim) );
225 ((Todo*)newInc)->setDtStart( ((Todo*)newInc)->dtDue().addSecs( -len ) );
226 ((Todo*)this)->setRecurDates();
227 }
220 } 228 }
221 return newInc; 229 return newInc;
222} 230}
223 231
224void Incidence::recreate() 232void Incidence::recreate()
225{ 233{
226 setCreated(QDateTime::currentDateTime()); 234 setCreated(QDateTime::currentDateTime());
227 235
228 setUid(CalFormat::createUniqueId()); 236 setUid(CalFormat::createUniqueId());
229 237
230 setRevision(0); 238 setRevision(0);
231 setIDStr( ":" ); 239 setIDStr( ":" );
diff --git a/libkcal/kincidenceformatter.cpp b/libkcal/kincidenceformatter.cpp
index 0d9c3f4..cc3088a 100644
--- a/libkcal/kincidenceformatter.cpp
+++ b/libkcal/kincidenceformatter.cpp
@@ -183,24 +183,36 @@ void KIncidenceFormatter::setTodo(Todo *event )
183 } 183 }
184 if (event->cancelled ()) { 184 if (event->cancelled ()) {
185 mText +="<font color=\"#B00000\">"; 185 mText +="<font color=\"#B00000\">";
186 addTag("i",i18n("This todo has been cancelled!")); 186 addTag("i",i18n("This todo has been cancelled!"));
187 mText.append("<br>"); 187 mText.append("<br>");
188 mText += "</font>"; 188 mText += "</font>";
189 } 189 }
190 190
191 if (!event->location().isEmpty()) { 191 if (!event->location().isEmpty()) {
192 addTag("b",i18n("Location: ")); 192 addTag("b",i18n("Location: "));
193 mText.append(event->location()+"<br>"); 193 mText.append(event->location()+"<br>");
194 } 194 }
195
196 if (event->recurrence()->doesRecur()) {
197
198 QString recurText = event->recurrence()->recurrenceText();
199 addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>");
200 }
201
202 if (event->hasStartDate()) {
203 mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(shortDate)));
204 }
205
206
195 if (event->hasDueDate()) { 207 if (event->hasDueDate()) {
196 mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(shortDate))); 208 mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(shortDate)));
197 } 209 }
198 mText.append(i18n("<p><b>Priority:</b> %2</p>") 210 mText.append(i18n("<p><b>Priority:</b> %2</p>")
199 .arg(QString::number(event->priority()))); 211 .arg(QString::number(event->priority())));
200 212
201 addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() ); 213 addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() );
202 formatCategories(event); 214 formatCategories(event);
203 if (!event->description().isEmpty()) { 215 if (!event->description().isEmpty()) {
204 addTag("p",i18n("<b>Details: </b>")); 216 addTag("p",i18n("<b>Details: </b>"));
205 addTag("p",event->description()); 217 addTag("p",event->description());
206 } 218 }
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp
index 1f54c2f..39d16b6 100644
--- a/libkcal/todo.cpp
+++ b/libkcal/todo.cpp
@@ -360,25 +360,25 @@ bool Todo::hasCompletedDate() const
360} 360}
361 361
362int Todo::percentComplete() const 362int Todo::percentComplete() const
363{ 363{
364 return mPercentComplete; 364 return mPercentComplete;
365} 365}
366bool Todo::setRecurDates() 366bool Todo::setRecurDates()
367{ 367{
368 if ( !mHasRecurrenceID ) 368 if ( !mHasRecurrenceID )
369 return true; 369 return true;
370 int secs = mDtStart.secsTo( dtDue() ); 370 int secs = mDtStart.secsTo( dtDue() );
371 bool ok; 371 bool ok;
372 qDebug("--------------------setRecurDates() "); 372 qDebug("T:setRecurDates() ");
373 //qDebug("%s %s %s ",mDtStart.toString().latin1(), dtDue().toString().latin1(),mRecurrenceID.toString().latin1() ); 373 //qDebug("%s %s %s ",mDtStart.toString().latin1(), dtDue().toString().latin1(),mRecurrenceID.toString().latin1() );
374 QDateTime next = getNextOccurence( mRecurrenceID, &ok ); 374 QDateTime next = getNextOccurence( mRecurrenceID, &ok );
375 if ( ok ) { 375 if ( ok ) {
376 mRecurrenceID = next; 376 mRecurrenceID = next;
377 mDtStart = next; 377 mDtStart = next;
378 setDtDue( next.addSecs( secs ) ); 378 setDtDue( next.addSecs( secs ) );
379 if ( QDateTime::currentDateTime() > next) 379 if ( QDateTime::currentDateTime() > next)
380 return false; 380 return false;
381 } else { 381 } else {
382 setHasRecurrenceID( false ); 382 setHasRecurrenceID( false );
383 recurrence()->unsetRecurs(); 383 recurrence()->unsetRecurs();
384 } 384 }
@@ -443,15 +443,15 @@ QDateTime Todo::getNextAlarmDateTime( bool * ok, int * offset ) const
443} 443}
444 444
445void Todo::checkSetCompletedFalse() 445void Todo::checkSetCompletedFalse()
446{ 446{
447 if ( !hasRecurrenceID() ) { 447 if ( !hasRecurrenceID() ) {
448 qDebug("ERROR 1 in Todo::checkSetCompletedFalse"); 448 qDebug("ERROR 1 in Todo::checkSetCompletedFalse");
449 } 449 }
450 // qDebug("Todo::checkSetCompletedFalse()"); 450 // qDebug("Todo::checkSetCompletedFalse()");
451 //qDebug("%s %s %s ",mDtStart.toString().latin1(), dtDue().toString().latin1(),mRecurrenceID.toString().latin1() ); 451 //qDebug("%s %s %s ",mDtStart.toString().latin1(), dtDue().toString().latin1(),mRecurrenceID.toString().latin1() );
452 if ( mPercentComplete == 100 && mDtStart == mRecurrenceID && QDateTime::currentDateTime() > mDtStart) { 452 if ( mPercentComplete == 100 && mDtStart == mRecurrenceID && QDateTime::currentDateTime() > mDtStart) {
453 qDebug("%s %s %s ",mDtStart.toString().latin1(), dtDue().toString().latin1(),mRecurrenceID.toString().latin1() ); 453 qDebug("%s %s %s ",mDtStart.toString().latin1(), dtDue().toString().latin1(),mRecurrenceID.toString().latin1() );
454 setCompleted( false ); 454 setCompleted( false );
455 qDebug("Todo::checkSetCompletedFalse++++++++++++++++++++++++++++ "); 455 qDebug("Todo::checkSetCompletedFalse ");
456 } 456 }
457} 457}