summaryrefslogtreecommitdiffabout
path: root/libkcal
Side-by-side diff
Diffstat (limited to 'libkcal') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/icalformatimpl.cpp2
-rw-r--r--libkcal/incidence.cpp16
-rw-r--r--libkcal/kincidenceformatter.cpp12
-rw-r--r--libkcal/todo.cpp4
4 files changed, 27 insertions, 7 deletions
diff --git a/libkcal/icalformatimpl.cpp b/libkcal/icalformatimpl.cpp
index bb9cb29..2e38ae3 100644
--- a/libkcal/icalformatimpl.cpp
+++ b/libkcal/icalformatimpl.cpp
@@ -1211,5 +1211,5 @@ void ICalFormatImpl::readIncidence(icalcomponent *parent,Incidence *incidence)
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
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp
index 0684af2..708ee6b 100644
--- a/libkcal/incidence.cpp
+++ b/libkcal/incidence.cpp
@@ -214,8 +214,16 @@ Incidence* Incidence::recreateCloneException( QDate d )
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
@@ -193,4 +193,16 @@ void KIncidenceFormatter::setTodo(Todo *event )
mText.append(event->location()+"<br>");
}
+
+ 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()) {
mText.append(i18n("<p><b>Due on:</b> %1</p>").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
@@ -370,5 +370,5 @@ bool Todo::setRecurDates()
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 );
@@ -453,5 +453,5 @@ void Todo::checkSetCompletedFalse()
qDebug("%s %s %s ",mDtStart.toString().latin1(), dtDue().toString().latin1(),mRecurrenceID.toString().latin1() );
setCompleted( false );
- qDebug("Todo::checkSetCompletedFalse++++++++++++++++++++++++++++ ");
+ qDebug("Todo::checkSetCompletedFalse ");
}
}