summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/oevent.cpp
authortille <tille>2003-05-08 13:55:09 (UTC)
committer tille <tille>2003-05-08 13:55:09 (UTC)
commit0cb4111d34d9fe96731f48983e1ff2e67262db02 (patch) (side-by-side diff)
treece6ec869ae7753ab0261e7ad075a10ad8b0a404b /libopie2/opiepim/oevent.cpp
parent78c60031b506b85dc20bd555d83486aeb831bf38 (diff)
downloadopie-0cb4111d34d9fe96731f48983e1ff2e67262db02.zip
opie-0cb4111d34d9fe96731f48983e1ff2e67262db02.tar.gz
opie-0cb4111d34d9fe96731f48983e1ff2e67262db02.tar.bz2
search stuff
and match, toRichText & toShortText in oevent
Diffstat (limited to 'libopie2/opiepim/oevent.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/oevent.cpp41
1 files changed, 36 insertions, 5 deletions
diff --git a/libopie2/opiepim/oevent.cpp b/libopie2/opiepim/oevent.cpp
index 3ba8a52..28cf873 100644
--- a/libopie2/opiepim/oevent.cpp
+++ b/libopie2/opiepim/oevent.cpp
@@ -2,6 +2,7 @@
#include <qpe/palmtopuidgen.h>
#include <qpe/categories.h>
+#include <qpe/stringutil.h>
#include "orecur.h"
#include "opimresolver.h"
@@ -210,16 +211,46 @@ QString OEvent::timeZone()const {
if (data->isAllDay ) return QString::fromLatin1("UTC");
return data->timezone;
}
-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;
}
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();
}
QString OEvent::type()const {
return QString::fromLatin1("OEvent");