summaryrefslogtreecommitdiff
path: root/libopie
Unidiff
Diffstat (limited to 'libopie') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/todoevent.cpp22
-rw-r--r--libopie/todoevent.h3
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 @@
2#include <opie/todoevent.h> 2#include <opie/todoevent.h>
3#include <qpe/palmtopuidgen.h> 3#include <qpe/palmtopuidgen.h>
4#include <qpe/stringutil.h> 4#include <qpe/stringutil.h>
5//#include <qpe/palmtoprecord.h> 5#include <qpe/palmtoprecord.h>
6 6
7ToDoEvent::ToDoEvent(const ToDoEvent &event ) 7ToDoEvent::ToDoEvent(const ToDoEvent &event )
8{ 8{
@@ -26,6 +26,23 @@ ToDoEvent::ToDoEvent(bool completed, int priority, const QString &category,
26 }// generate the ids 26 }// generate the ids
27 m_uid = uid; 27 m_uid = uid;
28} 28}
29QArray<int> ToDoEvent::categories()const
30{
31 QArray<int> array(1); // currently the datebook can be only in one category
32 array = Qtopia::Record::idsFromString( category() );
33 return array;
34}
35bool ToDoEvent::match( const QRegExp &regExp )const
36{
37 if( QString::number( m_priority ).find( regExp ) != -1 ){
38 return true;
39 }else if( m_hasDate && m_date.toString().find( regExp) != -1 ){
40 return true;
41 }else if(m_desc.find( regExp ) != -1 ){
42 return true;
43 }
44 return false;
45}
29bool ToDoEvent::isCompleted() const 46bool ToDoEvent::isCompleted() const
30{ 47{
31 return m_isCompleted; 48 return m_isCompleted;
@@ -64,7 +81,8 @@ void ToDoEvent::setDescription(const QString &desc )
64} 81}
65void ToDoEvent::setCategory( const QString &cat ) 82void ToDoEvent::setCategory( const QString &cat )
66{ 83{
67 m_category = cat; 84 qWarning("setCategory %s", cat.latin1() );
85 m_category = cat;
68} 86}
69void ToDoEvent::setPriority(int prio ) 87void ToDoEvent::setPriority(int prio )
70{ 88{
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 {
17 bool hasDate() const; 17 bool hasDate() const;
18 int priority()const ; 18 int priority()const ;
19 QString category()const; 19 QString category()const;
20 QArray<int> categories() const;
20 QDate date()const; 21 QDate date()const;
21 QString description()const; 22 QString description()const;
22 23
@@ -30,6 +31,8 @@ class ToDoEvent {
30 void setDescription(const QString& ); 31 void setDescription(const QString& );
31 bool isOverdue(); 32 bool isOverdue();
32 33
34 bool match( const QRegExp &r )const;
35
33 void setUid(int id) {m_uid = id; }; 36 void setUid(int id) {m_uid = id; };
34 bool operator<(const ToDoEvent &toDoEvent )const; 37 bool operator<(const ToDoEvent &toDoEvent )const;
35 bool operator<=(const ToDoEvent &toDoEvent )const; 38 bool operator<=(const ToDoEvent &toDoEvent )const;