summaryrefslogtreecommitdiffabout
path: root/libkcal/todo.cpp
Unidiff
Diffstat (limited to 'libkcal/todo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/todo.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp
index 7d04793..7f1de78 100644
--- a/libkcal/todo.cpp
+++ b/libkcal/todo.cpp
@@ -278,65 +278,69 @@ QString Todo::statusStr() const
278 return QString(""); 278 return QString("");
279} 279}
280#endif 280#endif
281 281
282bool Todo::isCompleted() const 282bool Todo::isCompleted() const
283{ 283{
284 if (mPercentComplete == 100) return true; 284 if (mPercentComplete == 100) return true;
285 else return false; 285 else return false;
286} 286}
287 287
288void Todo::setCompleted(bool completed) 288void Todo::setCompleted(bool completed)
289{ 289{
290 if (completed) mPercentComplete = 100; 290 if (completed) mPercentComplete = 100;
291 else { 291 else {
292 mPercentComplete = 0; 292 mPercentComplete = 0;
293 mHasCompletedDate = false; 293 mHasCompletedDate = false;
294 } 294 }
295 updated(); 295 updated();
296} 296}
297 297
298QDateTime Todo::completed() const 298QDateTime Todo::completed() const
299{ 299{
300 return mCompleted; 300 return mCompleted;
301} 301}
302 302
303QString Todo::completedStr( bool shortF ) const 303QString Todo::completedStr( bool shortF ) const
304{ 304{
305 return KGlobal::locale()->formatDateTime(mCompleted, shortF); 305 return KGlobal::locale()->formatDateTime(mCompleted, shortF);
306} 306}
307 307
308void Todo::setCompleted(const QDateTime &completed) 308void Todo::setCompleted(const QDateTime &completed)
309{ 309{
310 qDebug("Todo::setCompleted "); 310 //qDebug("Todo::setCompleted ");
311 if ( mHasCompletedDate ) {
312 // qDebug("has completed data - return ");
313 return;
314 }
311 mHasCompletedDate = true; 315 mHasCompletedDate = true;
312 mPercentComplete = 100; 316 mPercentComplete = 100;
313 mCompleted = getEvenTime(completed); 317 mCompleted = getEvenTime(completed);
314 updated(); 318 updated();
315} 319}
316 320
317bool Todo::hasCompletedDate() const 321bool Todo::hasCompletedDate() const
318{ 322{
319 return mHasCompletedDate; 323 return mHasCompletedDate;
320} 324}
321 325
322int Todo::percentComplete() const 326int Todo::percentComplete() const
323{ 327{
324 return mPercentComplete; 328 return mPercentComplete;
325} 329}
326 330
327void Todo::setPercentComplete(int v) 331void Todo::setPercentComplete(int v)
328{ 332{
329 mPercentComplete = v; 333 mPercentComplete = v;
330 if ( v != 100 ) 334 if ( v != 100 )
331 mHasCompletedDate = false; 335 mHasCompletedDate = false;
332 updated(); 336 updated();
333} 337}
334QDateTime Todo::getNextAlarmDateTime( bool * ok, int * offset ) const 338QDateTime Todo::getNextAlarmDateTime( bool * ok, int * offset ) const
335{ 339{
336 if ( isCompleted() || ! hasDueDate() || cancelled() ) { 340 if ( isCompleted() || ! hasDueDate() || cancelled() ) {
337 *ok = false; 341 *ok = false;
338 return QDateTime (); 342 return QDateTime ();
339 } 343 }
340 QDateTime incidenceStart; 344 QDateTime incidenceStart;
341 incidenceStart = dtDue(); 345 incidenceStart = dtDue();
342 bool enabled = false; 346 bool enabled = false;