From 7bd83e913399b8be68a7d37e8f02118ec9eab90e Mon Sep 17 00:00:00 2001 From: zautrix Date: Sun, 13 Feb 2005 19:07:45 +0000 Subject: todo fixi --- (limited to 'libkcal') diff --git a/libkcal/icalformatimpl.cpp b/libkcal/icalformatimpl.cpp index bb9cb29..2e38ae3 100644 --- a/libkcal/icalformatimpl.cpp +++ b/libkcal/icalformatimpl.cpp @@ -1210,7 +1210,7 @@ void ICalFormatImpl::readIncidence(icalcomponent *parent,Incidence *incidence) case ICAL_RECURRENCEID_PROPERTY: icaltime = icalproperty_get_recurrenceid(p); incidence->setRecurrenceID( readICalDateTime(icaltime) ); - qDebug(" RecurrenceID %s",incidence->recurrenceID().toString().latin1() ); + //qDebug(" RecurrenceID %s",incidence->recurrenceID().toString().latin1() ); break; #if 0 // status diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp index 0684af2..708ee6b 100644 --- a/libkcal/incidence.cpp +++ b/libkcal/incidence.cpp @@ -213,10 +213,18 @@ Incidence* Incidence::recreateCloneException( QDate d ) if ( doesRecur() ) { addExDate( d ); newInc->recurrence()->unsetRecurs(); - int len = dtStart().secsTo( ((Event*)this)->dtEnd()); - QTime tim = dtStart().time(); - newInc->setDtStart( QDateTime(d, tim) ); - ((Event*)newInc)->setDtEnd( newInc->dtStart().addSecs( len ) ); + if ( type() == "Event") { + int len = dtStart().secsTo( ((Event*)this)->dtEnd()); + QTime tim = dtStart().time(); + newInc->setDtStart( QDateTime(d, tim) ); + ((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(); + } } return newInc; } diff --git a/libkcal/kincidenceformatter.cpp b/libkcal/kincidenceformatter.cpp index 0d9c3f4..cc3088a 100644 --- a/libkcal/kincidenceformatter.cpp +++ b/libkcal/kincidenceformatter.cpp @@ -192,6 +192,18 @@ void KIncidenceFormatter::setTodo(Todo *event ) addTag("b",i18n("Location: ")); mText.append(event->location()+"
"); } + + if (event->recurrence()->doesRecur()) { + + QString recurText = event->recurrence()->recurrenceText(); + addTag("p","" + i18n("This is a %1 recurring todo.").arg(recurText ) + ""); + } + + if (event->hasStartDate()) { + mText.append(i18n("

Start on: %1

").arg(event->dtStartStr(shortDate))); + } + + if (event->hasDueDate()) { mText.append(i18n("

Due on: %1

").arg(event->dtDueStr(shortDate))); } diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp index 1f54c2f..39d16b6 100644 --- a/libkcal/todo.cpp +++ b/libkcal/todo.cpp @@ -369,7 +369,7 @@ bool Todo::setRecurDates() return true; int secs = mDtStart.secsTo( dtDue() ); bool ok; - qDebug("--------------------setRecurDates() "); + qDebug("T:setRecurDates() "); //qDebug("%s %s %s ",mDtStart.toString().latin1(), dtDue().toString().latin1(),mRecurrenceID.toString().latin1() ); QDateTime next = getNextOccurence( mRecurrenceID, &ok ); if ( ok ) { @@ -452,6 +452,6 @@ void Todo::checkSetCompletedFalse() if ( mPercentComplete == 100 && mDtStart == mRecurrenceID && QDateTime::currentDateTime() > mDtStart) { qDebug("%s %s %s ",mDtStart.toString().latin1(), dtDue().toString().latin1(),mRecurrenceID.toString().latin1() ); setCompleted( false ); - qDebug("Todo::checkSetCompletedFalse++++++++++++++++++++++++++++ "); + qDebug("Todo::checkSetCompletedFalse "); } } -- cgit v0.9.0.2