summaryrefslogtreecommitdiffabout
path: root/libkcal
authorzautrix <zautrix>2005-02-13 19:07:45 (UTC)
committer zautrix <zautrix>2005-02-13 19:07:45 (UTC)
commit7bd83e913399b8be68a7d37e8f02118ec9eab90e (patch) (side-by-side diff)
tree284d1592687ea4d3e0c220fafd289a702718dee4 /libkcal
parent293271fe9e6a9061da329183f8f488d79580f7da (diff)
downloadkdepimpi-7bd83e913399b8be68a7d37e8f02118ec9eab90e.zip
kdepimpi-7bd83e913399b8be68a7d37e8f02118ec9eab90e.tar.gz
kdepimpi-7bd83e913399b8be68a7d37e8f02118ec9eab90e.tar.bz2
todo fixi
Diffstat (limited to 'libkcal') (more/less context) (show whitespace changes)
-rw-r--r--libkcal/icalformatimpl.cpp2
-rw-r--r--libkcal/incidence.cpp8
-rw-r--r--libkcal/kincidenceformatter.cpp12
-rw-r--r--libkcal/todo.cpp4
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
@@ -1209,9 +1209,9 @@ 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
if ((vo = isAPropertyOf(vincidence, VCStatusProp)) != 0) {
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp
index 0684af2..708ee6b 100644
--- a/libkcal/incidence.cpp
+++ b/libkcal/incidence.cpp
@@ -212,12 +212,20 @@ Incidence* Incidence::recreateCloneException( QDate d )
newInc->recreate();
if ( doesRecur() ) {
addExDate( d );
newInc->recurrence()->unsetRecurs();
+ 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
@@ -191,8 +191,20 @@ void KIncidenceFormatter::setTodo(Todo *event )
if (!event->location().isEmpty()) {
addTag("b",i18n("Location: "));
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)));
}
mText.append(i18n("<p><b>Priority:</b> %2</p>")
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp
index 1f54c2f..39d16b6 100644
--- a/libkcal/todo.cpp
+++ b/libkcal/todo.cpp
@@ -368,9 +368,9 @@ bool Todo::setRecurDates()
if ( !mHasRecurrenceID )
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 ) {
mRecurrenceID = next;
@@ -451,7 +451,7 @@ void Todo::checkSetCompletedFalse()
//qDebug("%s %s %s ",mDtStart.toString().latin1(), dtDue().toString().latin1(),mRecurrenceID.toString().latin1() );
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 ");
}
}