-rw-r--r-- | libkcal/icalformatimpl.cpp | 2 | ||||
-rw-r--r-- | libkcal/incidence.cpp | 8 | ||||
-rw-r--r-- | libkcal/kincidenceformatter.cpp | 12 | ||||
-rw-r--r-- | libkcal/todo.cpp | 4 |
4 files changed, 23 insertions, 3 deletions
diff --git a/libkcal/icalformatimpl.cpp b/libkcal/icalformatimpl.cpp index bb9cb29..2e38ae3 100644 --- a/libkcal/icalformatimpl.cpp +++ b/libkcal/icalformatimpl.cpp @@ -1212,3 +1212,3 @@ void ICalFormatImpl::readIncidence(icalcomponent *parent,Incidence *incidence) incidence->setRecurrenceID( readICalDateTime(icaltime) ); - qDebug(" RecurrenceID %s",incidence->recurrenceID().toString().latin1() ); + //qDebug(" RecurrenceID %s",incidence->recurrenceID().toString().latin1() ); break; diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp index 0684af2..708ee6b 100644 --- a/libkcal/incidence.cpp +++ b/libkcal/incidence.cpp @@ -215,2 +215,3 @@ Incidence* Incidence::recreateCloneException( QDate d ) newInc->recurrence()->unsetRecurs(); + if ( type() == "Event") { int len = dtStart().secsTo( ((Event*)this)->dtEnd()); @@ -219,2 +220,9 @@ Incidence* Incidence::recreateCloneException( QDate d ) ((Event*)newInc)->setDtEnd( newInc->dtStart().addSecs( len ) ); + } else { + int len = dtStart().secsTo( ((Todo*)this)->dtDue()); + QTime tim = ((Todo*)this)->dtDue().time(); + ((Todo*)newInc)->setDtDue( QDateTime(d, tim) ); + ((Todo*)newInc)->setDtStart( ((Todo*)newInc)->dtDue().addSecs( -len ) ); + ((Todo*)this)->setRecurDates(); + } } diff --git a/libkcal/kincidenceformatter.cpp b/libkcal/kincidenceformatter.cpp index 0d9c3f4..cc3088a 100644 --- a/libkcal/kincidenceformatter.cpp +++ b/libkcal/kincidenceformatter.cpp @@ -194,2 +194,14 @@ void KIncidenceFormatter::setTodo(Todo *event ) } + + if (event->recurrence()->doesRecur()) { + + QString recurText = event->recurrence()->recurrenceText(); + addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>"); + } + + if (event->hasStartDate()) { + mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(shortDate))); + } + + if (event->hasDueDate()) { diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp index 1f54c2f..39d16b6 100644 --- a/libkcal/todo.cpp +++ b/libkcal/todo.cpp @@ -371,3 +371,3 @@ bool Todo::setRecurDates() bool ok; - qDebug("--------------------setRecurDates() "); + qDebug("T:setRecurDates() "); //qDebug("%s %s %s ",mDtStart.toString().latin1(), dtDue().toString().latin1(),mRecurrenceID.toString().latin1() ); @@ -454,3 +454,3 @@ void Todo::checkSetCompletedFalse() setCompleted( false ); - qDebug("Todo::checkSetCompletedFalse++++++++++++++++++++++++++++ "); + qDebug("Todo::checkSetCompletedFalse "); } |