diff options
Diffstat (limited to 'libkcal/incidenceformatter.cpp')
-rw-r--r-- | libkcal/incidenceformatter.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/libkcal/incidenceformatter.cpp b/libkcal/incidenceformatter.cpp index da3a7aae..887d000a 100644 --- a/libkcal/incidenceformatter.cpp +++ b/libkcal/incidenceformatter.cpp @@ -575,9 +575,22 @@ static TQString displayViewFormatEvent( Calendar *calendar, Event *event, } if ( !event->description().isEmpty() ) { + TQString description = event->description(); + + // Regular expression to match URLs + TQRegExp urlRegex("https?://[^\\s]+"); + + int pos = 0; + while ((pos = urlRegex.search(description, pos)) != -1) { + TQString url = urlRegex.cap(0); + TQString link = "<a href=\"" + url + "\">" + url + "</a>"; + description.replace(pos, url.length(), link); + pos += link.length(); + } + tmpStr += "<tr>"; tmpStr += "<td><b>" + i18n( "Description:" ) + "</b></td>"; - tmpStr += "<td>" + event->description() + "</td>"; + tmpStr += "<td>" + description + "</td>"; tmpStr += "</tr>"; } @@ -2837,7 +2850,7 @@ TQString IncidenceFormatter::msTNEFToVPart( const TQByteArray& tnef ) ICalFormat calFormat; Event* event = new Event(); - if( parser.openDevice( &TQT_TQIODEVICE_OBJECT(buf) ) ) { + if( parser.openDevice( &buf ) ) { KTNEFMessage* tnefMsg = parser.message(); //TQMap<int,KTNEFProperty*> props = parser.message()->properties(); |