-rw-r--r-- | libopie/todoevent.cpp | 22 | ||||
-rw-r--r-- | libopie/todoevent.h | 3 |
2 files changed, 23 insertions, 2 deletions
diff --git a/libopie/todoevent.cpp b/libopie/todoevent.cpp index daa25f4..7dbf907 100644 --- a/libopie/todoevent.cpp +++ b/libopie/todoevent.cpp @@ -2,7 +2,7 @@ #include <opie/todoevent.h> #include <qpe/palmtopuidgen.h> #include <qpe/stringutil.h> -//#include <qpe/palmtoprecord.h> +#include <qpe/palmtoprecord.h> ToDoEvent::ToDoEvent(const ToDoEvent &event ) { @@ -26,6 +26,23 @@ ToDoEvent::ToDoEvent(bool completed, int priority, const QString &category, }// generate the ids m_uid = uid; } +QArray<int> ToDoEvent::categories()const +{ + QArray<int> array(1); // currently the datebook can be only in one category + array = Qtopia::Record::idsFromString( category() ); + return array; +} +bool ToDoEvent::match( const QRegExp ®Exp )const +{ + if( QString::number( m_priority ).find( regExp ) != -1 ){ + return true; + }else if( m_hasDate && m_date.toString().find( regExp) != -1 ){ + return true; + }else if(m_desc.find( regExp ) != -1 ){ + return true; + } + return false; +} bool ToDoEvent::isCompleted() const { return m_isCompleted; @@ -64,7 +81,8 @@ void ToDoEvent::setDescription(const QString &desc ) } void ToDoEvent::setCategory( const QString &cat ) { - m_category = cat; + qWarning("setCategory %s", cat.latin1() ); + m_category = cat; } void ToDoEvent::setPriority(int prio ) { diff --git a/libopie/todoevent.h b/libopie/todoevent.h index bca7f6e..ac996a1 100644 --- a/libopie/todoevent.h +++ b/libopie/todoevent.h @@ -17,6 +17,7 @@ class ToDoEvent { bool hasDate() const; int priority()const ; QString category()const; + QArray<int> categories() const; QDate date()const; QString description()const; @@ -30,6 +31,8 @@ class ToDoEvent { void setDescription(const QString& ); bool isOverdue(); + bool match( const QRegExp &r )const; + void setUid(int id) {m_uid = id; }; bool operator<(const ToDoEvent &toDoEvent )const; bool operator<=(const ToDoEvent &toDoEvent )const; |