summaryrefslogtreecommitdiffabout
path: root/libkcal/kincidenceformatter.cpp
authorzautrix <zautrix>2007-06-06 13:14:20 (UTC)
committer zautrix <zautrix>2007-06-06 13:14:20 (UTC)
commit623b4d4abe87789dacd4c14de88a63b44ca352b7 (patch) (unidiff)
treea6bcc1b9359bf904e08b508576c2d2e958cde55c /libkcal/kincidenceformatter.cpp
parentd5c53970b9e12bfe774d1fecd603080aded24e09 (diff)
downloadkdepimpi-623b4d4abe87789dacd4c14de88a63b44ca352b7.zip
kdepimpi-623b4d4abe87789dacd4c14de88a63b44ca352b7.tar.gz
kdepimpi-623b4d4abe87789dacd4c14de88a63b44ca352b7.tar.bz2
display of next alarm of recurring events in event viewer fixed
Diffstat (limited to 'libkcal/kincidenceformatter.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/kincidenceformatter.cpp16
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
@@ -135,6 +135,14 @@ void KIncidenceFormatter::setEvent(Event *event)
135 if (event->isAlarmEnabled()) { 135 if (event->isAlarmEnabled()) {
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 ));
140 //addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); 148 //addTag("p", KGlobal::locale()->formatDateTime( t, shortDate ));
@@ -244,6 +252,14 @@ void KIncidenceFormatter::setTodo(Todo *event )
244 if (event->isAlarmEnabled()) { 252 if (event->isAlarmEnabled()) {
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>");
249 addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); 265 addTag("p", KGlobal::locale()->formatDateTime( t, shortDate ));