summaryrefslogtreecommitdiff
path: root/libopie/pim/oevent.cpp
Side-by-side diff
Diffstat (limited to 'libopie/pim/oevent.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/oevent.cpp41
1 files changed, 36 insertions, 5 deletions
diff --git a/libopie/pim/oevent.cpp b/libopie/pim/oevent.cpp
index 3ba8a52..28cf873 100644
--- a/libopie/pim/oevent.cpp
+++ b/libopie/pim/oevent.cpp
@@ -4,2 +4,3 @@
#include <qpe/categories.h>
+#include <qpe/stringutil.h>
@@ -212,4 +213,13 @@ QString OEvent::timeZone()const {
}
-bool OEvent::match( const QRegExp& )const {
- // FIXME
+bool OEvent::match( const QRegExp& re )const {
+ if (data->description.contains( re ) )
+ return true;
+ if ( data->note.contains( re ) )
+ return true;
+ if ( data->location.contains( re ) )
+ return true;
+ if ( data->start.toString().contains( re ) )
+ return true;
+ if ( data->end.toString().contains( re ) )
+ return true;
return false;
@@ -217,7 +227,28 @@ bool OEvent::match( const QRegExp& )const {
QString OEvent::toRichText()const {
- // FIXME
- return "OEvent test";
+ QString text;
+ if ( !description().isEmpty() ) {
+ text += "<b>" + QObject::tr( "Description:") + "</b><br>";
+ text += Qtopia::escapeString(description() ).
+ replace(QRegExp( "[\n]"), "<br>" ) + "<br>";
+ }
+ if ( startDateTime().isValid() ) {
+ text += "<b>" + QObject::tr( "Start:") + "</b> ";
+ text += Qtopia::escapeString(startDateTime().toString() ).
+ replace(QRegExp( "[\n]"), "<br>" ) + "<br>";
+ }
+ if ( endDateTime().isValid() ) {
+ text += "<b>" + QObject::tr( "End:") + "</b> ";
+ text += Qtopia::escapeString(endDateTime().toString() ).
+ replace(QRegExp( "[\n]"), "<br>" ) + "<br>";
+ }
+ if ( !note().isEmpty() ) {
+ text += "<b>" + QObject::tr( "Note:") + "</b><br>";
+ text += note();
+// text += Qtopia::escapeString(note() ).
+// replace(QRegExp( "[\n]"), "<br>" ) + "<br>";
+ }
+ return text;
}
QString OEvent::toShortText()const {
- return "OEvent shotText";
+ return description();
}