summaryrefslogtreecommitdiff
path: root/libopie/pim/oevent.cpp
authortille <tille>2003-05-08 13:55:09 (UTC)
committer tille <tille>2003-05-08 13:55:09 (UTC)
commit0cb4111d34d9fe96731f48983e1ff2e67262db02 (patch) (unidiff)
treece6ec869ae7753ab0261e7ad075a10ad8b0a404b /libopie/pim/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 '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
@@ -2,6 +2,7 @@
2 2
3#include <qpe/palmtopuidgen.h> 3#include <qpe/palmtopuidgen.h>
4#include <qpe/categories.h> 4#include <qpe/categories.h>
5#include <qpe/stringutil.h>
5 6
6#include "orecur.h" 7#include "orecur.h"
7#include "opimresolver.h" 8#include "opimresolver.h"
@@ -210,16 +211,46 @@ QString OEvent::timeZone()const {
210 if (data->isAllDay ) return QString::fromLatin1("UTC"); 211 if (data->isAllDay ) return QString::fromLatin1("UTC");
211 return data->timezone; 212 return data->timezone;
212} 213}
213bool OEvent::match( const QRegExp& )const { 214bool OEvent::match( const QRegExp& re )const {
214 // FIXME 215 if (data->description.contains( re ) )
216 return true;
217 if ( data->note.contains( re ) )
218 return true;
219 if ( data->location.contains( re ) )
220 return true;
221 if ( data->start.toString().contains( re ) )
222 return true;
223 if ( data->end.toString().contains( re ) )
224 return true;
215 return false; 225 return false;
216} 226}
217QString OEvent::toRichText()const { 227QString OEvent::toRichText()const {
218 // FIXME 228 QString text;
219 return "OEvent test"; 229 if ( !description().isEmpty() ) {
230 text += "<b>" + QObject::tr( "Description:") + "</b><br>";
231 text += Qtopia::escapeString(description() ).
232 replace(QRegExp( "[\n]"), "<br>" ) + "<br>";
233 }
234 if ( startDateTime().isValid() ) {
235 text += "<b>" + QObject::tr( "Start:") + "</b> ";
236 text += Qtopia::escapeString(startDateTime().toString() ).
237 replace(QRegExp( "[\n]"), "<br>" ) + "<br>";
238 }
239 if ( endDateTime().isValid() ) {
240 text += "<b>" + QObject::tr( "End:") + "</b> ";
241 text += Qtopia::escapeString(endDateTime().toString() ).
242 replace(QRegExp( "[\n]"), "<br>" ) + "<br>";
243 }
244 if ( !note().isEmpty() ) {
245 text += "<b>" + QObject::tr( "Note:") + "</b><br>";
246 text += note();
247// text += Qtopia::escapeString(note() ).
248// replace(QRegExp( "[\n]"), "<br>" ) + "<br>";
249 }
250 return text;
220} 251}
221QString OEvent::toShortText()const { 252QString OEvent::toShortText()const {
222 return "OEvent shotText"; 253 return description();
223} 254}
224QString OEvent::type()const { 255QString OEvent::type()const {
225 return QString::fromLatin1("OEvent"); 256 return QString::fromLatin1("OEvent");