summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt4
-rw-r--r--korganizer/calendarview.cpp14
-rw-r--r--korganizer/koagendaview.cpp17
-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.cpp16
-rw-r--r--libkcal/kincidenceformatter.cpp12
-rw-r--r--libkcal/todo.cpp4
11 files changed, 74 insertions, 13 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
@@ -1271,4 +1271,4 @@
{ "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!" },
-{ "","" },
-{ "","" },
+{ "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." },
+{ "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" },
{ "","" },
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 7c8316f..3dac20b 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -2265,2 +2265,5 @@ void CalendarView::slotSelectPickerDate( QDate d)
QTime tim;
+ int len = 0;
+ if ( to->hasStartDate() && to->hasDueDate() )
+ len = to->dtStart().secsTo( to->dtDue());
if ( to->hasDueDate() )
@@ -2274,2 +2277,11 @@ void CalendarView::slotSelectPickerDate( QDate d)
to->setDtDue( dt );
+
+ if ( to->hasStartDate() ) {
+ if ( len>0 )
+ to->setDtStart(to->dtDue().addSecs( -len ));
+ else
+ if (to->dtStart() > to->dtDue() )
+ to->setDtStart(to->dtDue().addDays( -3 ));
+ }
+
todoChanged( to );
@@ -3812,3 +3824,3 @@ bool CalendarView::removeCompletedSubTodos( Todo* t )
if ( deleteTodo ) {
- if ( t->isCompleted() ) {
+ if ( t->isCompleted() && !t->doesRecur()) {
checkExternalId( t );
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 13d8398..4ff6899 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -1001,3 +1001,16 @@ void KOAgendaView::updateEventDates(KOAgendaItem *item, int type)
} else if ( item->incidence()->type() == "Todo" ) {
- (static_cast<Todo*>(item->incidence()))->setDtDue(endDt);
+ Todo* to = static_cast<Todo*>(item->incidence());
+
+ int len = 0;
+ if ( to->hasStartDate() && to->hasDueDate() )
+ len = to->dtStart().secsTo( to->dtDue());
+ to->setDtDue(endDt);
+ if ( to->hasStartDate() ) {
+ if ( len>0 )
+ to->setDtStart(to->dtDue().addSecs( -len ));
+ else
+ if (to->dtStart() > to->dtDue() )
+ to->setDtStart(to->dtDue().addDays( -3 ));
+ }
+
}
@@ -1182,3 +1195,3 @@ void KOAgendaView::fillAgenda()
if ( ! todo->hasDueDate() && !todo->hasCompletedDate()) continue; // todo shall not be displayed if it has no date
-
+
// ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue.
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index 39921a0..f6c9624 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -404,2 +404,9 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
}
+
+ 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()) {
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index acd9265..d8e940b 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -158,3 +158,3 @@ bool ListItemVisitor::visit(Todo *t)
mItem->setText(5,t->isAlarmEnabled() ? i18n("Yes") : i18n("No"));
- mItem->setText(6,"---");
+ mItem->setText(6, t->recurrence()->recurrenceText());
if (t->hasDueDate()) {
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index f595d35..d0380e3 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -583,2 +583,5 @@ void MonthViewCell::insertTodo(Todo *todo)
item->setPalette( pal );
+ item->setRecur( todo->recurrence()->doesRecur() );
+ item->setAlarm( todo->isAlarmEnabled() );
+ item->setMoreInfo( todo->description().length() > 0 );
mItemList->insertItem( item );
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp
index 391b3bb..18dc656 100644
--- a/korganizer/kowhatsnextview.cpp
+++ b/korganizer/kowhatsnextview.cpp
@@ -669,2 +669,8 @@ bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub )
needClose =true;
+ }
+ if ( ev->doesRecur() ) {
+ if ( !needClose)
+ mText +="[";
+ mText += "r";
+ needClose =true;
}
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,6 +215,14 @@ Incidence* Incidence::recreateCloneException( QDate 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();
+ }
}
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 ");
}