summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/otodo.cpp
Unidiff
Diffstat (limited to 'libopie2/opiepim/otodo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/otodo.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/libopie2/opiepim/otodo.cpp b/libopie2/opiepim/otodo.cpp
index c84eeeb..38b93f7 100644
--- a/libopie2/opiepim/otodo.cpp
+++ b/libopie2/opiepim/otodo.cpp
@@ -270,25 +270,25 @@ QString OTodo::toShortText() const {
270*/ 270*/
271QString OTodo::toRichText() const 271QString OTodo::toRichText() const
272{ 272{
273 QString text; 273 QString text;
274 QStringList catlist; 274 QStringList catlist;
275 275
276 // summary 276 // summary
277 text += "<b><h3><img src=\"todo/TodoList\">"; 277 text += "<b><h3><img src=\"todo/TodoList\">";
278 if ( !summary().isEmpty() ) { 278 if ( !summary().isEmpty() ) {
279 text += Qtopia::escapeString(summary() ).replace(QRegExp( "[\n]"), "" ); 279 text += Qtopia::escapeString(summary() ).replace(QRegExp( "[\n]"), "" );
280 } 280 }
281 text += "</h3></b><br><hr><br>"; 281 text += "</h3></b><br><hr><br>";
282 282
283 // description 283 // description
284 if( !description().isEmpty() ){ 284 if( !description().isEmpty() ){
285 text += "<b>" + QObject::tr( "Description:" ) + "</b><br>"; 285 text += "<b>" + QObject::tr( "Description:" ) + "</b><br>";
286 text += Qtopia::escapeString(description() ).replace(QRegExp( "[\n]"), "<br>" ) ; 286 text += Qtopia::escapeString(description() ).replace(QRegExp( "[\n]"), "<br>" ) ;
287 } 287 }
288 288
289 // priority 289 // priority
290 int priorityval = priority(); 290 int priorityval = priority();
291 text += "<b>" + QObject::tr( "Priority:") +" </b><img src=\"todo/priority" + 291 text += "<b>" + QObject::tr( "Priority:") +" </b><img src=\"todo/priority" +
292 QString::number( priorityval ) + "\">"; 292 QString::number( priorityval ) + "\">";
293// text += "<b>" + QObject::tr( "Priority:") +"</b><img src=\"todo/priority" + 293// text += "<b>" + QObject::tr( "Priority:") +"</b><img src=\"todo/priority" +
294// QString::number( priority() ) + "\"><br>"; 294// QString::number( priority() ) + "\"><br>";
@@ -297,45 +297,45 @@ QString OTodo::toRichText() const
297 case 1 : text += QObject::tr( "Very high" ); 297 case 1 : text += QObject::tr( "Very high" );
298 break; 298 break;
299 case 2 : text += QObject::tr( "High" ); 299 case 2 : text += QObject::tr( "High" );
300 break; 300 break;
301 case 3 : text += QObject::tr( "Normal" ); 301 case 3 : text += QObject::tr( "Normal" );
302 break; 302 break;
303 case 4 : text += QObject::tr( "Low" ); 303 case 4 : text += QObject::tr( "Low" );
304 break; 304 break;
305 case 5 : text += QObject::tr( "Very low" ); 305 case 5 : text += QObject::tr( "Very low" );
306 break; 306 break;
307 }; 307 };
308 text += "<br>"; 308 text += "<br>";
309 309
310 // progress 310 // progress
311 text += "<b>" + QObject::tr( "Progress:") + " </b>" 311 text += "<b>" + QObject::tr( "Progress:") + " </b>"
312 + QString::number( progress() ) + " %<br>"; 312 + QString::number( progress() ) + " %<br>";
313 313
314 // due date 314 // due date
315 if (hasDueDate() ){ 315 if (hasDueDate() ){
316 QDate dd = dueDate(); 316 QDate dd = dueDate();
317 int off = QDate::currentDate().daysTo( dd ); 317 int off = QDate::currentDate().daysTo( dd );
318 318
319 text += "<b>" + QObject::tr( "Deadline:" ) + " </b><font color=\""; 319 text += "<b>" + QObject::tr( "Deadline:" ) + " </b><font color=\"";
320 if ( off < 0 ) 320 if ( off < 0 )
321 text += "#FF0000"; 321 text += "#FF0000";
322 else if ( off == 0 ) 322 else if ( off == 0 )
323 text += "#FFFF00"; 323 text += "#FFFF00";
324 else if ( off > 0 ) 324 else if ( off > 0 )
325 text += "#00FF00"; 325 text += "#00FF00";
326 326
327 text += "\">" + dd.toString() + "</font><br>"; 327 text += "\">" + dd.toString() + "</font><br>";
328 } 328 }
329 329
330 // categories 330 // categories
331 text += "<b>" + QObject::tr( "Category:") + "</b> "; 331 text += "<b>" + QObject::tr( "Category:") + "</b> ";
332 text += categoryNames( "Todo List" ).join(", "); 332 text += categoryNames( "Todo List" ).join(", ");
333 text += "<br>"; 333 text += "<br>";
334 334
335 return text; 335 return text;
336} 336}
337bool OTodo::hasNotifiers()const { 337bool OTodo::hasNotifiers()const {
338 if (!data->notifiers) return false; 338 if (!data->notifiers) return false;
339 return !data->notifiers->isEmpty(); 339 return !data->notifiers->isEmpty();
340} 340}
341OPimNotifyManager& OTodo::notifiers() { 341OPimNotifyManager& OTodo::notifiers() {
@@ -451,27 +451,24 @@ QMap<int, QString> OTodo::toMap() const {
451 map.insert( DateMonth, QString::number( data->date.month() ) ); 451 map.insert( DateMonth, QString::number( data->date.month() ) );
452 map.insert( DateYear, QString::number( data->date.year() ) ); 452 map.insert( DateYear, QString::number( data->date.year() ) );
453 map.insert( Progress, QString::number( data->prog ) ); 453 map.insert( Progress, QString::number( data->prog ) );
454// map.insert( CrossReference, crossToString() ); 454// map.insert( CrossReference, crossToString() );
455 /* FIXME!!! map.insert( State, ); 455 /* FIXME!!! map.insert( State, );
456 map.insert( Recurrence, ); 456 map.insert( Recurrence, );
457 map.insert( Reminders, ); 457 map.insert( Reminders, );
458 map. 458 map.
459 */ 459 */
460 return map; 460 return map;
461} 461}
462 462
463QMap<QString, QString> OTodo::toExtraMap()const {
464 return data->extra;
465}
466/** 463/**
467 * change or modify looks at the ref count and either 464 * change or modify looks at the ref count and either
468 * creates a new QShared Object or it can modify it 465 * creates a new QShared Object or it can modify it
469 * right in place 466 * right in place
470 */ 467 */
471void OTodo::changeOrModify() { 468void OTodo::changeOrModify() {
472 if ( data->count != 1 ) { 469 if ( data->count != 1 ) {
473 qWarning("changeOrModify"); 470 qWarning("changeOrModify");
474 data->deref(); 471 data->deref();
475 OTodoData* d2 = new OTodoData(); 472 OTodoData* d2 = new OTodoData();
476 copy(data, d2 ); 473 copy(data, d2 );
477 data = d2; 474 data = d2;