summaryrefslogtreecommitdiffabout
path: root/libkcal/kincidenceformatter.cpp
Unidiff
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 57a9ede..e506a96 100644
--- a/libkcal/kincidenceformatter.cpp
+++ b/libkcal/kincidenceformatter.cpp
@@ -289,105 +289,105 @@ void KIncidenceFormatter::addTag(const QString & tag,const QString & text)
289 289
290void KIncidenceFormatter::formatAttendees(Incidence *event) 290void KIncidenceFormatter::formatAttendees(Incidence *event)
291{ 291{
292 QPtrList<Attendee> attendees = event->attendees(); 292 QPtrList<Attendee> attendees = event->attendees();
293 if (attendees.count()) { 293 if (attendees.count()) {
294 QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small); 294 QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small);
295 QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small); 295 QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small);
296 addTag("h3",i18n("Organizer")); 296 addTag("h3",i18n("Organizer"));
297 mText.append("<ul><li>"); 297 mText.append("<ul><li>");
298#if 0 298#if 0
299 //ndef KORG_NOKABC 299 //ndef KORG_NOKABC
300 300
301 KABC::AddressBook *add_book = KABC::StdAddressBook::self(); 301 KABC::AddressBook *add_book = KABC::StdAddressBook::self();
302 KABC::Addressee::List addressList; 302 KABC::Addressee::List addressList;
303 addressList = add_book->findByEmail(event->organizer()); 303 addressList = add_book->findByEmail(event->organizer());
304 KABC::Addressee o = addressList.first(); 304 KABC::Addressee o = addressList.first();
305 if (!o.isEmpty() && addressList.size()<2) { 305 if (!o.isEmpty() && addressList.size()<2) {
306 mText += "<a href=\"uid:" + o.uid() + "\">"; 306 mText += "<a href=\"uid:" + o.uid() + "\">";
307 mText += o.formattedName(); 307 mText += o.formattedName();
308 mText += "</a>\n"; 308 mText += "</a>\n";
309 } else { 309 } else {
310 mText.append(event->organizer()); 310 mText.append(event->organizer());
311 } 311 }
312#else 312#else
313 mText.append(event->organizer()); 313 mText.append(event->organizer());
314#endif 314#endif
315 if (iconPath) { 315 if (iconPath) {
316 mText += " <a href=\"mailto:" + event->organizer() + "\">"; 316 mText += " <a href=\"mailto:" + event->organizer() + "\">";
317 mText += "<IMG src=\"" + iconPath + "\">"; 317 mText += "<IMG src=\"" + iconPath + "\">";
318 mText += "</a>\n"; 318 mText += "</a>\n";
319 } 319 }
320 mText.append("</li></ul>"); 320 mText.append("</li></ul>");
321 321
322 addTag("h3",i18n("Attendees")); 322 addTag("h3",i18n("Attendees"));
323 Attendee *a; 323 Attendee *a;
324 mText.append("<ul>"); 324 mText.append("<ul>");
325 for(a=attendees.first();a;a=attendees.next()) { 325 for(a=attendees.first();a;a=attendees.next()) {
326#if 0 326#if 0
327//ndef KORG_NOKABC 327//ndef KORG_NOKABC
328 if (a->name().isEmpty()) { 328 if (a->name().isEmpty()) {
329 addressList = add_book->findByEmail(a->email()); 329 addressList = add_book->findByEmail(a->email());
330 KABC::Addressee o = addressList.first(); 330 KABC::Addressee o = addressList.first();
331 if (!o.isEmpty() && addressList.size()<2) { 331 if (!o.isEmpty() && addressList.size()<2) {
332 mText += "<a href=\"uid:" + o.uid() + "\">"; 332 mText += "<a href=\"uid:" + o.uid() + "\">";
333 mText += o.formattedName(); 333 mText += o.formattedName();
334 mText += "</a>\n"; 334 mText += "</a>\n";
335 } else { 335 } else {
336 mText += "<li>"; 336 mText += "<li>";
337 mText.append(a->email()); 337 mText.append(a->email());
338 mText += "\n"; 338 mText += "\n";
339 } 339 }
340 } else { 340 } else {
341 mText += "<li><a href=\"uid:" + a->uid() + "\">"; 341 mText += "<li><a href=\"uid:" + a->uid() + "\">";
342 if (!a->name().isEmpty()) mText += a->name(); 342 if (!a->name().isEmpty()) mText += a->name();
343 else mText += a->email(); 343 else mText += a->email();
344 mText += "</a>\n"; 344 mText += "</a>\n";
345 } 345 }
346#else 346#else
347 //qDebug("nokabc "); 347 //qDebug("nokabc ");
348 mText += "<li><a href=\"uid:" + a->uid() + "\">"; 348 mText += "<li><a href=\"uid:" + a->uid() + "\">";
349 if (!a->name().isEmpty()) mText += a->name(); 349 if (!a->name().isEmpty()) mText += a->name();
350 else mText += a->email(); 350 else mText += a->email();
351 mText += "</a>\n"; 351 mText += "</a>\n";
352#endif 352#endif
353 353
354 if (!a->email().isEmpty()) { 354 if (!a->email().isEmpty()) {
355 if (iconPath) { 355 if (iconPath) {
356 mText += "<a href=\"mailto:" + a->name() +" "+ "<" + a->email() + ">" + "\">"; 356 mText += "<a href=\"mailto:" + a->name() +" "+ "<" + a->email() + ">" + "\">";
357 if ( a->RSVP() ) 357 if ( a->RSVP() )
358 mText += "<IMG src=\"" + iconPath + "\">"; 358 mText += "<IMG src=\"" + iconPath + "\">";
359 else 359 else
360 mText += "<IMG src=\"" + NOiconPath + "\">"; 360 mText += "<IMG src=\"" + NOiconPath + "\">";
361 mText += "</a>\n"; 361 mText += "</a>\n";
362 } 362 }
363 } 363 }
364 if (a->status() != Attendee::NeedsAction ) 364 if (a->status() != Attendee::NeedsAction )
365 mText +="[" + a->statusStr() + "] "; 365 mText +="[" + a->statusStr() + "] ";
366 if (a->role() == Attendee::Chair ) 366 if (a->role() == Attendee::Chair )
367 mText +="(" + a->roleStr().left(1) + ".)"; 367 mText +="(" + a->roleStr().left(1) + ".)";
368 } 368 }
369 mText.append("</li></ul>"); 369 mText.append("</li></ul>");
370 } 370 }
371} 371}
372 372
373void KIncidenceFormatter::formatReadOnly(Incidence *event) 373void KIncidenceFormatter::formatReadOnly(Incidence *event)
374{ 374{
375 if (event->isReadOnly()) { 375 if (event->isReadOnly()) {
376 addTag("p","<em>(" + i18n("read-only") + ")</em>"); 376 addTag("p","<em>(" + i18n("read-only") + ")</em>");
377 } 377 }
378} 378}
379QString KIncidenceFormatter::deTag(QString text) 379QString KIncidenceFormatter::deTag(QString text)
380{ 380{
381#if QT_VERSION >= 0x030000 381#if QT_VERSION >= 0x030000
382 text.replace( '<' , "&lt;" ); 382 text.replace( '<' , "&lt;" );
383 text.replace( '>' , "&gt;" ); 383 text.replace( '>' , "&gt;" );
384#else 384#else
385 if ( text.find ('<') > 0 ) { 385 if ( text.find ('<') >= 0 ) {
386 text.replace( QRegExp("<") , "&lt;" ); 386 text.replace( QRegExp("<") , "&lt;" );
387 } 387 }
388 if ( text.find ('>') > 0 ) { 388 if ( text.find ('>') >= 0 ) {
389 text.replace( QRegExp(">") , "&gt;" ); 389 text.replace( QRegExp(">") , "&gt;" );
390 } 390 }
391#endif 391#endif
392 return text; 392 return text;
393} 393}