-rw-r--r-- | libopie/todoevent.cpp | 22 |
1 files changed, 20 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 | |||
@@ -1,9 +1,9 @@ | |||
1 | 1 | ||
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 | ||
7 | ToDoEvent::ToDoEvent(const ToDoEvent &event ) | 7 | ToDoEvent::ToDoEvent(const ToDoEvent &event ) |
8 | { | 8 | { |
9 | *this = event; | 9 | *this = event; |
@@ -25,8 +25,25 @@ ToDoEvent::ToDoEvent(bool completed, int priority, const QString &category, | |||
25 | delete uidgen; | 25 | delete uidgen; |
26 | }// generate the ids | 26 | }// generate the ids |
27 | m_uid = uid; | 27 | m_uid = uid; |
28 | } | 28 | } |
29 | QArray<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 | } | ||
35 | bool ToDoEvent::match( const QRegExp ®Exp )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 | } | ||
29 | bool ToDoEvent::isCompleted() const | 46 | bool ToDoEvent::isCompleted() const |
30 | { | 47 | { |
31 | return m_isCompleted; | 48 | return m_isCompleted; |
32 | } | 49 | } |
@@ -63,9 +80,10 @@ void ToDoEvent::setDescription(const QString &desc ) | |||
63 | m_desc = Qtopia::simplifyMultiLineSpace(desc ); | 80 | m_desc = Qtopia::simplifyMultiLineSpace(desc ); |
64 | } | 81 | } |
65 | void ToDoEvent::setCategory( const QString &cat ) | 82 | void ToDoEvent::setCategory( const QString &cat ) |
66 | { | 83 | { |
67 | m_category = cat; | 84 | qWarning("setCategory %s", cat.latin1() ); |
85 | m_category = cat; | ||
68 | } | 86 | } |
69 | void ToDoEvent::setPriority(int prio ) | 87 | void ToDoEvent::setPriority(int prio ) |
70 | { | 88 | { |
71 | m_priority = prio; | 89 | m_priority = prio; |