-rw-r--r-- | libopie2/opiepim/otodo.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libopie2/opiepim/otodo.cpp b/libopie2/opiepim/otodo.cpp index 5a18c37..189bf94 100644 --- a/libopie2/opiepim/otodo.cpp +++ b/libopie2/opiepim/otodo.cpp | |||
@@ -242,97 +242,97 @@ void OTodo::setState( const OPimState& state ) { | |||
242 | data->state = new OPimState( state ); | 242 | data->state = new OPimState( state ); |
243 | } | 243 | } |
244 | void OTodo::setRecurrence( const ORecur& rec) { | 244 | void OTodo::setRecurrence( const ORecur& rec) { |
245 | changeOrModify(); | 245 | changeOrModify(); |
246 | if (data->recur ) | 246 | if (data->recur ) |
247 | (*data->recur) = rec; | 247 | (*data->recur) = rec; |
248 | else | 248 | else |
249 | data->recur = new ORecur( rec ); | 249 | data->recur = new ORecur( rec ); |
250 | } | 250 | } |
251 | void OTodo::setMaintainer( const OPimMaintainer& pim ) { | 251 | void OTodo::setMaintainer( const OPimMaintainer& pim ) { |
252 | changeOrModify(); | 252 | changeOrModify(); |
253 | 253 | ||
254 | if (data->maintainer ) | 254 | if (data->maintainer ) |
255 | (*data->maintainer) = pim; | 255 | (*data->maintainer) = pim; |
256 | else | 256 | else |
257 | data->maintainer = new OPimMaintainer( pim ); | 257 | data->maintainer = new OPimMaintainer( pim ); |
258 | } | 258 | } |
259 | bool OTodo::isOverdue( ) | 259 | bool OTodo::isOverdue( ) |
260 | { | 260 | { |
261 | if( data->hasDate && !data->isCompleted) | 261 | if( data->hasDate && !data->isCompleted) |
262 | return QDate::currentDate() > data->date; | 262 | return QDate::currentDate() > data->date; |
263 | return false; | 263 | return false; |
264 | } | 264 | } |
265 | void OTodo::setProgress(ushort progress ) | 265 | void OTodo::setProgress(ushort progress ) |
266 | { | 266 | { |
267 | changeOrModify(); | 267 | changeOrModify(); |
268 | data->prog = progress; | 268 | data->prog = progress; |
269 | } | 269 | } |
270 | QString OTodo::toShortText() const { | 270 | QString OTodo::toShortText() const { |
271 | return summary(); | 271 | return summary(); |
272 | } | 272 | } |
273 | /*! | 273 | /*! |
274 | Returns a richt text string | 274 | Returns a richt text string |
275 | */ | 275 | */ |
276 | QString OTodo::toRichText() const | 276 | QString OTodo::toRichText() const |
277 | { | 277 | { |
278 | QString text; | 278 | QString text; |
279 | QStringList catlist; | 279 | QStringList catlist; |
280 | 280 | ||
281 | // summary | 281 | // summary |
282 | text += "<b><h3><img src=\"todo/TodoList\"> "; | 282 | text += "<b><h3><img src=\"todo/TodoList\"> "; |
283 | if ( !summary().isEmpty() ) { | 283 | if ( !summary().isEmpty() ) { |
284 | text += Qtopia::escapeString(summary() ).replace(QRegExp( "[\n]"), "" ); | 284 | text += Qtopia::escapeString(summary() ).replace(QRegExp( "[\n]"), "" ); |
285 | } | 285 | } |
286 | text += "</h3></b><br><hr><br>"; | 286 | text += "</h3></b><br><hr><br>"; |
287 | 287 | ||
288 | // description | 288 | // description |
289 | if( !description().isEmpty() ){ | 289 | if( !description().isEmpty() ){ |
290 | text += "<b>" + QObject::tr( "Notes:" ) + "</b><br>"; | 290 | text += "<b>" + QObject::tr( "Description:" ) + "</b><br>"; |
291 | text += Qtopia::escapeString(description() ).replace(QRegExp( "[\n]"), "<br>" ) + "<br>"; | 291 | text += Qtopia::escapeString(description() ).replace(QRegExp( "[\n]"), "<br>" ) + "<br>"; |
292 | } | 292 | } |
293 | 293 | ||
294 | // priority | 294 | // priority |
295 | int priorityval = priority(); | 295 | int priorityval = priority(); |
296 | text += "<b>" + QObject::tr( "Priority:") +" </b><img src=\"todo/priority" + | 296 | text += "<b>" + QObject::tr( "Priority:") +" </b><img src=\"todo/priority" + |
297 | QString::number( priorityval ) + "\"> "; | 297 | QString::number( priorityval ) + "\"> "; |
298 | 298 | ||
299 | switch ( priorityval ) | 299 | switch ( priorityval ) |
300 | { | 300 | { |
301 | case 1 : text += QObject::tr( "Very high" ); | 301 | case 1 : text += QObject::tr( "Very high" ); |
302 | break; | 302 | break; |
303 | case 2 : text += QObject::tr( "High" ); | 303 | case 2 : text += QObject::tr( "High" ); |
304 | break; | 304 | break; |
305 | case 3 : text += QObject::tr( "Normal" ); | 305 | case 3 : text += QObject::tr( "Normal" ); |
306 | break; | 306 | break; |
307 | case 4 : text += QObject::tr( "Low" ); | 307 | case 4 : text += QObject::tr( "Low" ); |
308 | break; | 308 | break; |
309 | case 5 : text += QObject::tr( "Very low" ); | 309 | case 5 : text += QObject::tr( "Very low" ); |
310 | break; | 310 | break; |
311 | }; | 311 | }; |
312 | text += "<br>"; | 312 | text += "<br>"; |
313 | 313 | ||
314 | // progress | 314 | // progress |
315 | text += "<b>" + QObject::tr( "Progress:") + " </b>" | 315 | text += "<b>" + QObject::tr( "Progress:") + " </b>" |
316 | + QString::number( progress() ) + " %<br>"; | 316 | + QString::number( progress() ) + " %<br>"; |
317 | 317 | ||
318 | // due date | 318 | // due date |
319 | if (hasDueDate() ){ | 319 | if (hasDueDate() ){ |
320 | QDate dd = dueDate(); | 320 | QDate dd = dueDate(); |
321 | int off = QDate::currentDate().daysTo( dd ); | 321 | int off = QDate::currentDate().daysTo( dd ); |
322 | 322 | ||
323 | text += "<b>" + QObject::tr( "Deadline:" ) + " </b><font color=\""; | 323 | text += "<b>" + QObject::tr( "Deadline:" ) + " </b><font color=\""; |
324 | if ( off < 0 ) | 324 | if ( off < 0 ) |
325 | text += "#FF0000"; | 325 | text += "#FF0000"; |
326 | else if ( off == 0 ) | 326 | else if ( off == 0 ) |
327 | text += "#FFFF00"; | 327 | text += "#FFFF00"; |
328 | else if ( off > 0 ) | 328 | else if ( off > 0 ) |
329 | text += "#00FF00"; | 329 | text += "#00FF00"; |
330 | 330 | ||
331 | text += "\">" + dd.toString() + "</font><br>"; | 331 | text += "\">" + dd.toString() + "</font><br>"; |
332 | } | 332 | } |
333 | 333 | ||
334 | // categories | 334 | // categories |
335 | text += "<b>" + QObject::tr( "Category:") + "</b> "; | 335 | text += "<b>" + QObject::tr( "Category:") + "</b> "; |
336 | text += categoryNames( "Todo List" ).join(", "); | 336 | text += categoryNames( "Todo List" ).join(", "); |
337 | text += "<br>"; | 337 | text += "<br>"; |
338 | 338 | ||