summaryrefslogtreecommitdiffabout
path: root/libkcal/kincidenceformatter.cpp
Side-by-side diff
Diffstat (limited to 'libkcal/kincidenceformatter.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/kincidenceformatter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libkcal/kincidenceformatter.cpp b/libkcal/kincidenceformatter.cpp
index 9359fad..f8f40f1 100644
--- a/libkcal/kincidenceformatter.cpp
+++ b/libkcal/kincidenceformatter.cpp
@@ -60,97 +60,97 @@ void KIncidenceFormatter::setEvent(Event *event)
}
if ( mColorMode == 2 ) {
mText +="<font color=\"#C00000\">";
}
// mText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>";
if ( mode == 1 ) {
addTag("h2",i18n( "Local: " ) +deTag(event->summary()));
} else {
addTag("h2",i18n( "Remote: " ) +deTag(event->summary()));
}
formatReadOnly(event);
addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) );
if ( mColorMode )
mText += "</font>";
}
if (event->cancelled ()) {
mText +="<font color=\"#B00000\">";
addTag("i",i18n("This event has been cancelled!"));
mText.append("<br>");
mText += "</font>";
}
if (event->doesFloat()) {
if (event->isMultiDay()) {
mText.append(i18n("<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>")
.arg(event->dtStartDateStr(shortDate))
.arg(event->dtEndDateStr(shortDate)));
} else {
mText.append(i18n("<p><b>On:</b> %1</p>").arg(event->dtStartDateStr( shortDate )));
}
} else {
if (event->isMultiDay()) {
mText.append(i18n("<p><b>From:</b> %1</p> ")
.arg(event->dtStartStr( shortDate)));
mText.append(i18n("<p><b>To:</b> %1</p>")
.arg(event->dtEndStr(shortDate)));
} else {
mText.append(i18n("<p><b>From:</b> %1 <b>To:</b> %2</p>")
.arg(event->dtStartTimeStr())
.arg(event->dtEndTimeStr()));
mText.append(i18n("<p><b>On:</b> %1</p> ")
.arg(event->dtStartDateStr( shortDate )));
}
}
if (!event->location().isEmpty()) {
addTag("b",i18n("Location: "));
mText.append(deTag(event->location())+"<br>");
}
- if (event->recurrence()->doesRecur()) {
+ if (event->doesRecur()) {
QString recurText = event->recurrence()->recurrenceText();
addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>");
bool ok;
QDate start = QDate::currentDate();
QDateTime next;
next = event->getNextOccurence( QDateTime::currentDateTime() , &ok );
if ( ok ) {
addTag("p",i18n("<b>Next recurrence is on:</b>") );
addTag("p", KGlobal::locale()->formatDate( next.date(), shortDate ));
} else {
bool last;
QDate nextd;
nextd = event->recurrence()->getPreviousDate( QDate::currentDate() , &last );
if ( last ) {
addTag("p",i18n("<b>Last recurrence was on:</b>") );
addTag("p", KGlobal::locale()->formatDate( nextd, shortDate ));
}
}
}
if (event->isAlarmEnabled()) {
Alarm *alarm =event->alarms().first() ;
QDateTime t = alarm->time();
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);
}
addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() );
// mText.append(event->secrecyStr()+"<br>");
formatCategories(event);
formatAttendees(event);
if ( mCreated ) {
#ifdef DESKTOP_VERSION
addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate ));
#else
addTag("p",i18n("<b>Created: ") +" </b>");
addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate ));
#endif
@@ -171,97 +171,97 @@ void KIncidenceFormatter::setEvent(Event *event)
addTag("p",deTag(event->description()));
}
}
}
void KIncidenceFormatter::setTodo(Todo *event )
{
int mode = 0;
mCurrentIncidence = event;
bool shortDate = true;
if (mode == 0 ) {
addTag("h3",deTag(event->summary()));
formatReadOnly(event);
}
else {
if ( mColorMode == 1 ) {
mText +="<font color=\"#00A000\">";
}
if ( mColorMode == 2 ) {
mText +="<font color=\"#B00000\">";
}
if ( mode == 1 ) {
addTag("h2",i18n( "Local: " ) +deTag(event->summary()));
} else {
addTag("h2",i18n( "Remote: " ) +deTag(event->summary()));
}
formatReadOnly(event);
addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) );
if ( mColorMode )
mText += "</font>";
}
if ( event->percentComplete() == 100 && event->hasCompletedDate() ) {
mText +="<font color=\"#B00000\">";
addTag("i", i18n("<p><i>Completed on %1</i></p>").arg( event->completedStr(shortDate) ) );
mText += "</font>";
} else {
mText.append(i18n("<p><i>%1 % completed</i></p>")
.arg(event->percentComplete()));
}
if (event->cancelled ()) {
mText +="<font color=\"#B00000\">";
addTag("i",i18n("This todo has been cancelled!"));
mText.append("<br>");
mText += "</font>";
}
- if (event->recurrence()->doesRecur()) {
+ if (event->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()) {
mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(shortDate)));
}
if (!event->location().isEmpty()) {
addTag("b",i18n("Location: "));
mText.append(deTag(event->location())+"<br>");
}
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();
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);
}
addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() );
formatCategories(event);
formatAttendees(event);
if ( mCreated ) {
#ifdef DESKTOP_VERSION
addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate ));
#else
addTag("p",i18n("<b>Created: ") +" </b>");
addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate ));
#endif
}
if ( mModified ) {
#ifdef DESKTOP_VERSION
addTag("p",i18n("<b>Last modified: ") +" </b>"+KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ));
#else