author | zautrix <zautrix> | 2007-06-06 13:14:20 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2007-06-06 13:14:20 (UTC) |
commit | 623b4d4abe87789dacd4c14de88a63b44ca352b7 (patch) (side-by-side diff) | |
tree | a6bcc1b9359bf904e08b508576c2d2e958cde55c /libkcal | |
parent | d5c53970b9e12bfe774d1fecd603080aded24e09 (diff) | |
download | kdepimpi-623b4d4abe87789dacd4c14de88a63b44ca352b7.zip kdepimpi-623b4d4abe87789dacd4c14de88a63b44ca352b7.tar.gz kdepimpi-623b4d4abe87789dacd4c14de88a63b44ca352b7.tar.bz2 |
display of next alarm of recurring events in event viewer fixed
-rw-r--r-- | libkcal/kincidenceformatter.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libkcal/kincidenceformatter.cpp b/libkcal/kincidenceformatter.cpp index 4dfe16a..733b897 100644 --- a/libkcal/kincidenceformatter.cpp +++ b/libkcal/kincidenceformatter.cpp @@ -132,12 +132,20 @@ void KIncidenceFormatter::setEvent(Event *event) } if (event->isAlarmEnabled()) { 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 )); //addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); //addTag("p",s); } @@ -241,12 +249,20 @@ void KIncidenceFormatter::setTodo(Todo *event ) mText.append(i18n("<p><b>Priority:</b> %2</p>") .arg(QString::number(event->priority()))); if (event->isAlarmEnabled()) { 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>"); addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); //addTag("p",s); } |