summaryrefslogtreecommitdiff
path: root/libopie/pim/otodo.cpp
Unidiff
Diffstat (limited to 'libopie/pim/otodo.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie/pim/otodo.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/libopie/pim/otodo.cpp b/libopie/pim/otodo.cpp
index f3df119..a29d88e 100644
--- a/libopie/pim/otodo.cpp
+++ b/libopie/pim/otodo.cpp
@@ -277,55 +277,61 @@ QString OTodo::toRichText() const
277 if( !description().isEmpty() ){ 277 if( !description().isEmpty() ){
278 text += "<b>" + QObject::tr( "Description:" ) + "</b><br>"; 278 text += "<b>" + QObject::tr( "Description:" ) + "</b><br>";
279 text += Qtopia::escapeString(description() ).replace(QRegExp( "[\n]"), "<br>" ) ; 279 text += Qtopia::escapeString(description() ).replace(QRegExp( "[\n]"), "<br>" ) ;
280 } 280 }
281 text += "<br><br><br>"; 281 text += "<br><br><br>";
282 282
283 text += "<b>" + QObject::tr( "Priority:") +" </b>" 283 text += "<b>" + QObject::tr( "Priority:") +" </b>"
284 + QString::number( priority() ) + " <br>"; 284 + QString::number( priority() ) + " <br>";
285 text += "<b>" + QObject::tr( "Progress:") + " </b>" 285 text += "<b>" + QObject::tr( "Progress:") + " </b>"
286 + QString::number( progress() ) + " %<br>"; 286 + QString::number( progress() ) + " %<br>";
287 if (hasDueDate() ){ 287 if (hasDueDate() ){
288 text += "<b>" + QObject::tr( "Deadline:") + " </b>"; 288 text += "<b>" + QObject::tr( "Deadline:") + " </b>";
289 text += dueDate().toString(); 289 text += dueDate().toString();
290 text += "<br>"; 290 text += "<br>";
291 } 291 }
292 292
293 text += "<b>" + QObject::tr( "Category:") + "</b> "; 293 text += "<b>" + QObject::tr( "Category:") + "</b> ";
294 text += categoryNames( "Todo List" ).join(", "); 294 text += categoryNames( "Todo List" ).join(", ");
295 text += "<br>"; 295 text += "<br>";
296 296
297 return text; 297 return text;
298} 298}
299bool OTodo::hasNotifiers()const { 299bool OTodo::hasNotifiers()const {
300 if (!data->notifiers) return false; 300 if (!data->notifiers) return false;
301 return data->notifiers->isEmpty(); 301 return !data->notifiers->isEmpty();
302} 302}
303OPimNotifyManager& OTodo::notifiers() { 303OPimNotifyManager& OTodo::notifiers() {
304 if (!data->notifiers ) 304 if (!data->notifiers )
305 data->notifiers = new OPimNotifyManager; 305 data->notifiers = new OPimNotifyManager;
306 return (*data->notifiers); 306 return (*data->notifiers);
307} 307}
308const OPimNotifyManager& OTodo::notifiers()const{
309 if (!data->notifiers )
310 data->notifiers = new OPimNotifyManager;
311
312 return (*data->notifiers);
313}
308 314
309bool OTodo::operator<( const OTodo &toDoEvent )const{ 315bool OTodo::operator<( const OTodo &toDoEvent )const{
310 if( !hasDueDate() && !toDoEvent.hasDueDate() ) return true; 316 if( !hasDueDate() && !toDoEvent.hasDueDate() ) return true;
311 if( !hasDueDate() && toDoEvent.hasDueDate() ) return false; 317 if( !hasDueDate() && toDoEvent.hasDueDate() ) return false;
312 if( hasDueDate() && toDoEvent.hasDueDate() ){ 318 if( hasDueDate() && toDoEvent.hasDueDate() ){
313 if( dueDate() == toDoEvent.dueDate() ){ // let's the priority decide 319 if( dueDate() == toDoEvent.dueDate() ){ // let's the priority decide
314 return priority() < toDoEvent.priority(); 320 return priority() < toDoEvent.priority();
315 }else{ 321 }else{
316 return dueDate() < toDoEvent.dueDate(); 322 return dueDate() < toDoEvent.dueDate();
317 } 323 }
318 } 324 }
319 return false; 325 return false;
320} 326}
321bool OTodo::operator<=(const OTodo &toDoEvent )const 327bool OTodo::operator<=(const OTodo &toDoEvent )const
322{ 328{
323 if( !hasDueDate() && !toDoEvent.hasDueDate() ) return true; 329 if( !hasDueDate() && !toDoEvent.hasDueDate() ) return true;
324 if( !hasDueDate() && toDoEvent.hasDueDate() ) return true; 330 if( !hasDueDate() && toDoEvent.hasDueDate() ) return true;
325 if( hasDueDate() && toDoEvent.hasDueDate() ){ 331 if( hasDueDate() && toDoEvent.hasDueDate() ){
326 if( dueDate() == toDoEvent.dueDate() ){ // let's the priority decide 332 if( dueDate() == toDoEvent.dueDate() ){ // let's the priority decide
327 return priority() <= toDoEvent.priority(); 333 return priority() <= toDoEvent.priority();
328 }else{ 334 }else{
329 return dueDate() <= toDoEvent.dueDate(); 335 return dueDate() <= toDoEvent.dueDate();
330 } 336 }
331 } 337 }