-rw-r--r-- | libopie/todoevent.cpp | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/libopie/todoevent.cpp b/libopie/todoevent.cpp index 28b2e98..a5dba4f 100644 --- a/libopie/todoevent.cpp +++ b/libopie/todoevent.cpp | |||
@@ -1,39 +1,38 @@ | |||
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; |
10 | } | 10 | } |
11 | 11 | ||
12 | ToDoEvent::ToDoEvent(bool completed, int priority, const QStringList &category, | 12 | ToDoEvent::ToDoEvent(bool completed, int priority, const QStringList &category, |
13 | const QString &description, bool hasDate, QDate date, int uid ) | 13 | const QString &description, bool hasDate, QDate date, int uid ) |
14 | { | 14 | { |
15 | qWarning("todoEvent c'tor" ); | ||
16 | m_date = date; | 15 | m_date = date; |
17 | m_isCompleted = completed; | 16 | m_isCompleted = completed; |
18 | m_hasDate = hasDate; | 17 | m_hasDate = hasDate; |
19 | m_priority = priority; | 18 | m_priority = priority; |
20 | m_category = category; | 19 | m_category = category; |
21 | m_desc = Qtopia::simplifyMultiLineSpace(description ); | 20 | m_desc = Qtopia::simplifyMultiLineSpace(description ); |
22 | if (uid == -1 ) { | 21 | if (uid == -1 ) { |
23 | Qtopia::UidGen *uidgen = new Qtopia::UidGen(); | 22 | Qtopia::UidGen *uidgen = new Qtopia::UidGen(); |
24 | uid = uidgen->generate(); | 23 | uid = uidgen->generate(); |
25 | delete uidgen; | 24 | delete uidgen; |
26 | }// generate the ids | 25 | }// generate the ids |
27 | m_uid = uid; | 26 | m_uid = uid; |
28 | } | 27 | } |
29 | QArray<int> ToDoEvent::categories()const | 28 | QArray<int> ToDoEvent::categories()const |
30 | { | 29 | { |
31 | QArray<int> array(m_category.count() ); // currently the datebook can be only in one category | 30 | QArray<int> array(m_category.count() ); // currently the datebook can be only in one category |
32 | array = Qtopia::Record::idsFromString( m_category.join(";") ); | 31 | array = Qtopia::Record::idsFromString( m_category.join(";") ); |
33 | return array; | 32 | return array; |
34 | } | 33 | } |
35 | bool ToDoEvent::match( const QRegExp ®Exp )const | 34 | bool ToDoEvent::match( const QRegExp ®Exp )const |
36 | { | 35 | { |
37 | if( QString::number( m_priority ).find( regExp ) != -1 ){ | 36 | if( QString::number( m_priority ).find( regExp ) != -1 ){ |
38 | return true; | 37 | return true; |
39 | }else if( m_hasDate && m_date.toString().find( regExp) != -1 ){ | 38 | }else if( m_hasDate && m_date.toString().find( regExp) != -1 ){ |
@@ -49,49 +48,48 @@ bool ToDoEvent::isCompleted() const | |||
49 | } | 48 | } |
50 | bool ToDoEvent::hasDate() const | 49 | bool ToDoEvent::hasDate() const |
51 | { | 50 | { |
52 | return m_hasDate; | 51 | return m_hasDate; |
53 | } | 52 | } |
54 | int ToDoEvent::priority()const | 53 | int ToDoEvent::priority()const |
55 | { | 54 | { |
56 | return m_priority; | 55 | return m_priority; |
57 | } | 56 | } |
58 | QStringList ToDoEvent::allCategories()const | 57 | QStringList ToDoEvent::allCategories()const |
59 | { | 58 | { |
60 | return m_category; | 59 | return m_category; |
61 | } | 60 | } |
62 | void ToDoEvent::insertCategory(const QString &str ) | 61 | void ToDoEvent::insertCategory(const QString &str ) |
63 | { | 62 | { |
64 | m_category.append( str ); | 63 | m_category.append( str ); |
65 | } | 64 | } |
66 | void ToDoEvent::clearCategories() | 65 | void ToDoEvent::clearCategories() |
67 | { | 66 | { |
68 | m_category.clear(); | 67 | m_category.clear(); |
69 | } | 68 | } |
70 | void ToDoEvent::setCategories(const QStringList &list ) | 69 | void ToDoEvent::setCategories(const QStringList &list ) |
71 | { | 70 | { |
72 | m_category = list; | 71 | m_category = list; |
73 | qWarning("todoevent: %s", list.join(";" ).latin1() ); | ||
74 | } | 72 | } |
75 | QDate ToDoEvent::date()const | 73 | QDate ToDoEvent::date()const |
76 | { | 74 | { |
77 | return m_date; | 75 | return m_date; |
78 | } | 76 | } |
79 | 77 | ||
80 | QString ToDoEvent::description()const | 78 | QString ToDoEvent::description()const |
81 | { | 79 | { |
82 | return m_desc; | 80 | return m_desc; |
83 | } | 81 | } |
84 | void ToDoEvent::setCompleted( bool completed ) | 82 | void ToDoEvent::setCompleted( bool completed ) |
85 | { | 83 | { |
86 | m_isCompleted = completed; | 84 | m_isCompleted = completed; |
87 | } | 85 | } |
88 | void ToDoEvent::setHasDate( bool hasDate ) | 86 | void ToDoEvent::setHasDate( bool hasDate ) |
89 | { | 87 | { |
90 | m_hasDate = hasDate; | 88 | m_hasDate = hasDate; |
91 | } | 89 | } |
92 | void ToDoEvent::setDescription(const QString &desc ) | 90 | void ToDoEvent::setDescription(const QString &desc ) |
93 | { | 91 | { |
94 | m_desc = Qtopia::simplifyMultiLineSpace(desc ); | 92 | m_desc = Qtopia::simplifyMultiLineSpace(desc ); |
95 | } | 93 | } |
96 | void ToDoEvent::setCategory( const QString &cat ) | 94 | void ToDoEvent::setCategory( const QString &cat ) |
97 | { | 95 | { |