summaryrefslogtreecommitdiff
path: root/libopie/pim/otodo.cpp
Unidiff
Diffstat (limited to 'libopie/pim/otodo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/otodo.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/libopie/pim/otodo.cpp b/libopie/pim/otodo.cpp
index 38b93f7..5a18c37 100644
--- a/libopie/pim/otodo.cpp
+++ b/libopie/pim/otodo.cpp
@@ -19,24 +19,29 @@
19#include "opimresolver.h" 19#include "opimresolver.h"
20 20
21#include "otodo.h" 21#include "otodo.h"
22 22
23 23
24struct OTodo::OTodoData : public QShared { 24struct OTodo::OTodoData : public QShared {
25 OTodoData() : QShared() { 25 OTodoData() : QShared() {
26 recur = 0; 26 recur = 0;
27 state = 0; 27 state = 0;
28 maintainer = 0; 28 maintainer = 0;
29 notifiers = 0; 29 notifiers = 0;
30 }; 30 };
31 ~OTodoData() {
32 delete recur;
33 delete maintainer;
34 delete notifiers;
35 }
31 36
32 QDate date; 37 QDate date;
33 bool isCompleted:1; 38 bool isCompleted:1;
34 bool hasDate:1; 39 bool hasDate:1;
35 int priority; 40 int priority;
36 QString desc; 41 QString desc;
37 QString sum; 42 QString sum;
38 QMap<QString, QString> extra; 43 QMap<QString, QString> extra;
39 ushort prog; 44 ushort prog;
40 OPimState *state; 45 OPimState *state;
41 ORecur *recur; 46 ORecur *recur;
42 OPimMaintainer *maintainer; 47 OPimMaintainer *maintainer;
@@ -265,42 +270,41 @@ void OTodo::setProgress(ushort progress )
265QString OTodo::toShortText() const { 270QString OTodo::toShortText() const {
266 return summary(); 271 return summary();
267} 272}
268/*! 273/*!
269 Returns a richt text string 274 Returns a richt text string
270*/ 275*/
271QString OTodo::toRichText() const 276QString OTodo::toRichText() const
272{ 277{
273 QString text; 278 QString text;
274 QStringList catlist; 279 QStringList catlist;
275 280
276 // summary 281 // summary
277 text += "<b><h3><img src=\"todo/TodoList\">"; 282 text += "<b><h3><img src=\"todo/TodoList\"> ";
278 if ( !summary().isEmpty() ) { 283 if ( !summary().isEmpty() ) {
279 text += Qtopia::escapeString(summary() ).replace(QRegExp( "[\n]"), "" ); 284 text += Qtopia::escapeString(summary() ).replace(QRegExp( "[\n]"), "" );
280 } 285 }
281 text += "</h3></b><br><hr><br>"; 286 text += "</h3></b><br><hr><br>";
282 287
283 // description 288 // description
284 if( !description().isEmpty() ){ 289 if( !description().isEmpty() ){
285 text += "<b>" + QObject::tr( "Description:" ) + "</b><br>"; 290 text += "<b>" + QObject::tr( "Notes:" ) + "</b><br>";
286 text += Qtopia::escapeString(description() ).replace(QRegExp( "[\n]"), "<br>" ) ; 291 text += Qtopia::escapeString(description() ).replace(QRegExp( "[\n]"), "<br>" ) + "<br>";
287 } 292 }
288 293
289 // priority 294 // priority
290 int priorityval = priority(); 295 int priorityval = priority();
291 text += "<b>" + QObject::tr( "Priority:") +" </b><img src=\"todo/priority" + 296 text += "<b>" + QObject::tr( "Priority:") +" </b><img src=\"todo/priority" +
292 QString::number( priorityval ) + "\">"; 297 QString::number( priorityval ) + "\"> ";
293// text += "<b>" + QObject::tr( "Priority:") +"</b><img src=\"todo/priority" + 298
294// QString::number( priority() ) + "\"><br>";
295 switch ( priorityval ) 299 switch ( priorityval )
296 { 300 {
297 case 1 : text += QObject::tr( "Very high" ); 301 case 1 : text += QObject::tr( "Very high" );
298 break; 302 break;
299 case 2 : text += QObject::tr( "High" ); 303 case 2 : text += QObject::tr( "High" );
300 break; 304 break;
301 case 3 : text += QObject::tr( "Normal" ); 305 case 3 : text += QObject::tr( "Normal" );
302 break; 306 break;
303 case 4 : text += QObject::tr( "Low" ); 307 case 4 : text += QObject::tr( "Low" );
304 break; 308 break;
305 case 5 : text += QObject::tr( "Very low" ); 309 case 5 : text += QObject::tr( "Very low" );
306 break; 310 break;