-rw-r--r-- | korganizer/koeventviewer.cpp | 20 | ||||
-rw-r--r-- | libkcal/kincidenceformatter.cpp | 16 |
2 files changed, 35 insertions, 1 deletions
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp index 607e549..92d2a80 100644 --- a/korganizer/koeventviewer.cpp +++ b/korganizer/koeventviewer.cpp @@ -397,4 +397,14 @@ void KOEventViewer::appendEvent(Event *event, int mode ) Alarm *alarm =event->alarms().first() ; QDateTime t = alarm->time(); + + if (event->doesRecur()) { + bool ok = false; + int offset = 0; + QDateTime next = event->getNextAlarmDateTime(& ok, &offset, QDateTime::currentDateTime() ) ; + if ( ok ) { + t = next; + } + } + QString s =i18n("( %1 before )").arg( alarm->offsetText() ); if(wideScreen ){ @@ -519,5 +529,13 @@ void KOEventViewer::appendTodo(Todo *event, int mode ) Alarm *alarm =event->alarms().first() ; QDateTime t = alarm->time(); - QString s =i18n("( %1 before )").arg( alarm->offsetText() ); + if (event->doesRecur()) { + bool ok = false; + int offset = 0; + QDateTime next = event->getNextAlarmDateTime(& ok, &offset, QDateTime::currentDateTime() ) ; + if ( ok ) { + t = next; + } + } + QString s =i18n("( %1 before )").arg( alarm->offsetText() ); if ( wideScreen ) { addTag("p",i18n("<b>Alarm on: ") + s +" </b>"+ KGlobal::locale()->formatDateTime( t, shortDate )); diff --git a/libkcal/kincidenceformatter.cpp b/libkcal/kincidenceformatter.cpp index 4dfe16a..733b897 100644 --- a/libkcal/kincidenceformatter.cpp +++ b/libkcal/kincidenceformatter.cpp @@ -136,4 +136,12 @@ void KIncidenceFormatter::setEvent(Event *event) Alarm *alarm =event->alarms().first() ; QDateTime t = alarm->time(); + if (event->doesRecur()) { + bool ok = false; + int offset = 0; + QDateTime next = event->getNextAlarmDateTime(& ok, &offset, QDateTime::currentDateTime() ) ; + if ( ok ) { + t = next; + } + } QString s =i18n("( %1 before )").arg( alarm->offsetText() ); addTag("p",i18n("<b>Alarm on: </b>") + s + ": "+KGlobal::locale()->formatDateTime( t, shortDate )); @@ -245,4 +253,12 @@ void KIncidenceFormatter::setTodo(Todo *event ) Alarm *alarm =event->alarms().first() ; QDateTime t = alarm->time(); + if (event->doesRecur()) { + bool ok = false; + int offset = 0; + QDateTime next = event->getNextAlarmDateTime(& ok, &offset, QDateTime::currentDateTime() ) ; + if ( ok ) { + t = next; + } + } QString s =i18n("( %1 before )").arg( alarm->offsetText() ); addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); |