-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 ) | |||
397 | Alarm *alarm =event->alarms().first() ; | 397 | Alarm *alarm =event->alarms().first() ; |
398 | QDateTime t = alarm->time(); | 398 | QDateTime t = alarm->time(); |
399 | |||
400 | if (event->doesRecur()) { | ||
401 | bool ok = false; | ||
402 | int offset = 0; | ||
403 | QDateTime next = event->getNextAlarmDateTime(& ok, &offset, QDateTime::currentDateTime() ) ; | ||
404 | if ( ok ) { | ||
405 | t = next; | ||
406 | } | ||
407 | } | ||
408 | |||
399 | QString s =i18n("( %1 before )").arg( alarm->offsetText() ); | 409 | QString s =i18n("( %1 before )").arg( alarm->offsetText() ); |
400 | if(wideScreen ){ | 410 | if(wideScreen ){ |
@@ -519,5 +529,13 @@ void KOEventViewer::appendTodo(Todo *event, int mode ) | |||
519 | Alarm *alarm =event->alarms().first() ; | 529 | Alarm *alarm =event->alarms().first() ; |
520 | QDateTime t = alarm->time(); | 530 | QDateTime t = alarm->time(); |
521 | QString s =i18n("( %1 before )").arg( alarm->offsetText() ); | 531 | if (event->doesRecur()) { |
532 | bool ok = false; | ||
533 | int offset = 0; | ||
534 | QDateTime next = event->getNextAlarmDateTime(& ok, &offset, QDateTime::currentDateTime() ) ; | ||
535 | if ( ok ) { | ||
536 | t = next; | ||
537 | } | ||
538 | } | ||
539 | QString s =i18n("( %1 before )").arg( alarm->offsetText() ); | ||
522 | if ( wideScreen ) { | 540 | if ( wideScreen ) { |
523 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"+ KGlobal::locale()->formatDateTime( t, shortDate )); | 541 | 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) | |||
136 | Alarm *alarm =event->alarms().first() ; | 136 | Alarm *alarm =event->alarms().first() ; |
137 | QDateTime t = alarm->time(); | 137 | QDateTime t = alarm->time(); |
138 | if (event->doesRecur()) { | ||
139 | bool ok = false; | ||
140 | int offset = 0; | ||
141 | QDateTime next = event->getNextAlarmDateTime(& ok, &offset, QDateTime::currentDateTime() ) ; | ||
142 | if ( ok ) { | ||
143 | t = next; | ||
144 | } | ||
145 | } | ||
138 | QString s =i18n("( %1 before )").arg( alarm->offsetText() ); | 146 | QString s =i18n("( %1 before )").arg( alarm->offsetText() ); |
139 | addTag("p",i18n("<b>Alarm on: </b>") + s + ": "+KGlobal::locale()->formatDateTime( t, shortDate )); | 147 | addTag("p",i18n("<b>Alarm on: </b>") + s + ": "+KGlobal::locale()->formatDateTime( t, shortDate )); |
@@ -245,4 +253,12 @@ void KIncidenceFormatter::setTodo(Todo *event ) | |||
245 | Alarm *alarm =event->alarms().first() ; | 253 | Alarm *alarm =event->alarms().first() ; |
246 | QDateTime t = alarm->time(); | 254 | QDateTime t = alarm->time(); |
255 | if (event->doesRecur()) { | ||
256 | bool ok = false; | ||
257 | int offset = 0; | ||
258 | QDateTime next = event->getNextAlarmDateTime(& ok, &offset, QDateTime::currentDateTime() ) ; | ||
259 | if ( ok ) { | ||
260 | t = next; | ||
261 | } | ||
262 | } | ||
247 | QString s =i18n("( %1 before )").arg( alarm->offsetText() ); | 263 | QString s =i18n("( %1 before )").arg( alarm->offsetText() ); |
248 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); | 264 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); |