-rw-r--r-- | libopie2/opiepim/oevent.cpp | 56 |
1 files changed, 44 insertions, 12 deletions
diff --git a/libopie2/opiepim/oevent.cpp b/libopie2/opiepim/oevent.cpp index 83b191f..e4f5d92 100644 --- a/libopie2/opiepim/oevent.cpp +++ b/libopie2/opiepim/oevent.cpp | |||
@@ -237,18 +237,50 @@ bool OEvent::match( const QRegExp& re )const { | |||
237 | QString OEvent::toRichText()const { | 237 | QString OEvent::toRichText()const { |
238 | QString text; | 238 | QString text, value; |
239 | |||
240 | // description | ||
241 | text += "<b><h3><img src=\"datebook/DateBook\">"; | ||
239 | if ( !description().isEmpty() ) { | 242 | if ( !description().isEmpty() ) { |
240 | text += "<b>" + QObject::tr( "Description:") + "</b><br>"; | 243 | text += Qtopia::escapeString(description() ).replace(QRegExp( "[\n]"), "" ); |
241 | text += Qtopia::escapeString(description() ). | 244 | } |
242 | replace(QRegExp( "[\n]"), "<br>" ) + "<br>"; | 245 | text += "</h3></b><br><hr><br>"; |
246 | |||
247 | // location | ||
248 | if ( !(value = location()).isEmpty() ) { | ||
249 | text += "<b>" + QObject::tr( "Location:" ) + "</b> "; | ||
250 | text += Qtopia::escapeString(value) + "<br>"; | ||
251 | } | ||
252 | |||
253 | // all day event | ||
254 | if ( isAllDay() ) { | ||
255 | text += "<b><i>" + QObject::tr( "This is an all day event" ) + "</i></b><br>"; | ||
243 | } | 256 | } |
244 | if ( startDateTime().isValid() ) { | 257 | // multiple day event |
245 | text += "<b>" + QObject::tr( "Start:") + "</b> "; | 258 | else if ( isMultipleDay () ) { |
246 | text += Qtopia::escapeString(startDateTime().toString() ). | 259 | text += "<b><i>" + QObject::tr( "This is a multiple day event" ) + "</i></b><br>"; |
247 | replace(QRegExp( "[\n]"), "<br>" ) + "<br>"; | 260 | } |
261 | // start & end times | ||
262 | else { | ||
263 | // start time | ||
264 | if ( startDateTime().isValid() ) { | ||
265 | text += "<b>" + QObject::tr( "Start:") + "</b> "; | ||
266 | text += Qtopia::escapeString(startDateTime().toString() ). | ||
267 | replace(QRegExp( "[\n]"), "<br>" ) + "<br>"; | ||
268 | } | ||
269 | |||
270 | // end time | ||
271 | if ( endDateTime().isValid() ) { | ||
272 | text += "<b>" + QObject::tr( "End:") + "</b> "; | ||
273 | text += Qtopia::escapeString(endDateTime().toString() ). | ||
274 | replace(QRegExp( "[\n]"), "<br>" ) + "<br>"; | ||
275 | } | ||
248 | } | 276 | } |
249 | if ( endDateTime().isValid() ) { | 277 | |
250 | text += "<b>" + QObject::tr( "End:") + "</b> "; | 278 | // categories |
251 | text += Qtopia::escapeString(endDateTime().toString() ). | 279 | if ( categoryNames("Calendar").count() ){ |
252 | replace(QRegExp( "[\n]"), "<br>" ) + "<br>"; | 280 | text += "<b>" + QObject::tr( "Category:") + "</b> "; |
281 | text += categoryNames("Calendar").join(", "); | ||
282 | text += "<br>"; | ||
253 | } | 283 | } |
284 | |||
285 | //notes | ||
254 | if ( !note().isEmpty() ) { | 286 | if ( !note().isEmpty() ) { |