-rw-r--r-- | libopie2/opiepim/otodo.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libopie2/opiepim/otodo.cpp b/libopie2/opiepim/otodo.cpp index a29d88e..e087a00 100644 --- a/libopie2/opiepim/otodo.cpp +++ b/libopie2/opiepim/otodo.cpp | |||
@@ -84,55 +84,59 @@ OTodo::OTodo(bool completed, int priority, | |||
84 | OTodo::OTodo(bool completed, int priority, | 84 | OTodo::OTodo(bool completed, int priority, |
85 | const QStringList &category, | 85 | const QStringList &category, |
86 | const QString& summary, | 86 | const QString& summary, |
87 | const QString &description, | 87 | const QString &description, |
88 | ushort progress, | 88 | ushort progress, |
89 | bool hasDate, QDate date, int uid ) | 89 | bool hasDate, QDate date, int uid ) |
90 | : OPimRecord( uid ) | 90 | : OPimRecord( uid ) |
91 | { | 91 | { |
92 | // qWarning("OTodoData" + summary); | 92 | // qWarning("OTodoData" + summary); |
93 | setCategories( idsFromString( category.join(";") ) ); | 93 | setCategories( idsFromString( category.join(";") ) ); |
94 | 94 | ||
95 | data = new OTodoData; | 95 | data = new OTodoData; |
96 | 96 | ||
97 | data->date = date; | 97 | data->date = date; |
98 | data->isCompleted = completed; | 98 | data->isCompleted = completed; |
99 | data->hasDate = hasDate; | 99 | data->hasDate = hasDate; |
100 | data->priority = priority; | 100 | data->priority = priority; |
101 | data->sum = summary; | 101 | data->sum = summary; |
102 | data->prog = progress; | 102 | data->prog = progress; |
103 | data->desc = Qtopia::simplifyMultiLineSpace(description ); | 103 | data->desc = Qtopia::simplifyMultiLineSpace(description ); |
104 | } | 104 | } |
105 | bool OTodo::match( const QRegExp ®Exp )const | 105 | bool OTodo::match( const QRegExp ®Exp )const |
106 | { | 106 | { |
107 | if( QString::number( data->priority ).find( regExp ) != -1 ){ | 107 | if( QString::number( data->priority ).find( regExp ) != -1 ){ |
108 | return true; | 108 | setLastHitField( Priority ); |
109 | return true; | ||
109 | }else if( data->hasDate && data->date.toString().find( regExp) != -1 ){ | 110 | }else if( data->hasDate && data->date.toString().find( regExp) != -1 ){ |
110 | return true; | 111 | setLastHitField( HasDate ); |
112 | return true; | ||
111 | }else if(data->desc.find( regExp ) != -1 ){ | 113 | }else if(data->desc.find( regExp ) != -1 ){ |
112 | return true; | 114 | setLastHitField( Description ); |
115 | return true; | ||
113 | }else if(data->sum.find( regExp ) != -1 ) { | 116 | }else if(data->sum.find( regExp ) != -1 ) { |
114 | return true; | 117 | setLastHitField( Summary ); |
118 | return true; | ||
115 | } | 119 | } |
116 | return false; | 120 | return false; |
117 | } | 121 | } |
118 | bool OTodo::isCompleted() const | 122 | bool OTodo::isCompleted() const |
119 | { | 123 | { |
120 | return data->isCompleted; | 124 | return data->isCompleted; |
121 | } | 125 | } |
122 | bool OTodo::hasDueDate() const | 126 | bool OTodo::hasDueDate() const |
123 | { | 127 | { |
124 | return data->hasDate; | 128 | return data->hasDate; |
125 | } | 129 | } |
126 | bool OTodo::hasStartDate()const { | 130 | bool OTodo::hasStartDate()const { |
127 | return data->start.isValid(); | 131 | return data->start.isValid(); |
128 | } | 132 | } |
129 | bool OTodo::hasCompletedDate()const { | 133 | bool OTodo::hasCompletedDate()const { |
130 | return data->completed.isValid(); | 134 | return data->completed.isValid(); |
131 | } | 135 | } |
132 | int OTodo::priority()const | 136 | int OTodo::priority()const |
133 | { | 137 | { |
134 | return data->priority; | 138 | return data->priority; |
135 | } | 139 | } |
136 | QString OTodo::summary() const | 140 | QString OTodo::summary() const |
137 | { | 141 | { |
138 | return data->sum; | 142 | return data->sum; |