author | zautrix <zautrix> | 2005-01-30 01:41:12 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-30 01:41:12 (UTC) |
commit | 949c6e28c83668176fd9c29e12668322c6ae627f (patch) (unidiff) | |
tree | f5b21c9fe6d9f1906a7bca6899b44bcf359f2cc6 /libkcal/todo.cpp | |
parent | a8fae20ad7bcb59df9a603c88accf3a10401c2f9 (diff) | |
download | kdepimpi-949c6e28c83668176fd9c29e12668322c6ae627f.zip kdepimpi-949c6e28c83668176fd9c29e12668322c6ae627f.tar.gz kdepimpi-949c6e28c83668176fd9c29e12668322c6ae627f.tar.bz2 |
bugs
-rw-r--r-- | libkcal/todo.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp index 3d2de61..7362bdf 100644 --- a/libkcal/todo.cpp +++ b/libkcal/todo.cpp | |||
@@ -275,33 +275,36 @@ QString Todo::statusStr() const | |||
275 | return QString("DELEGATED"); | 275 | return QString("DELEGATED"); |
276 | break; | 276 | break; |
277 | } | 277 | } |
278 | return QString(""); | 278 | return QString(""); |
279 | } | 279 | } |
280 | #endif | 280 | #endif |
281 | 281 | ||
282 | bool Todo::isCompleted() const | 282 | bool 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 | ||
288 | void Todo::setCompleted(bool completed) | 288 | void Todo::setCompleted(bool completed) |
289 | { | 289 | { |
290 | if (completed) mPercentComplete = 100; | 290 | if (completed) mPercentComplete = 100; |
291 | else mPercentComplete = 0; | 291 | else { |
292 | mPercentComplete = 0; | ||
293 | mHasCompletedDate = false; | ||
294 | } | ||
292 | updated(); | 295 | updated(); |
293 | } | 296 | } |
294 | 297 | ||
295 | QDateTime Todo::completed() const | 298 | QDateTime Todo::completed() const |
296 | { | 299 | { |
297 | return mCompleted; | 300 | return mCompleted; |
298 | } | 301 | } |
299 | 302 | ||
300 | QString Todo::completedStr() const | 303 | QString Todo::completedStr() const |
301 | { | 304 | { |
302 | return KGlobal::locale()->formatDateTime(mCompleted); | 305 | return KGlobal::locale()->formatDateTime(mCompleted); |
303 | } | 306 | } |
304 | 307 | ||
305 | void Todo::setCompleted(const QDateTime &completed) | 308 | void Todo::setCompleted(const QDateTime &completed) |
306 | { | 309 | { |
307 | mHasCompletedDate = true; | 310 | mHasCompletedDate = true; |
@@ -310,32 +313,34 @@ void Todo::setCompleted(const QDateTime &completed) | |||
310 | updated(); | 313 | updated(); |
311 | } | 314 | } |
312 | 315 | ||
313 | bool Todo::hasCompletedDate() const | 316 | bool Todo::hasCompletedDate() const |
314 | { | 317 | { |
315 | return mHasCompletedDate; | 318 | return mHasCompletedDate; |
316 | } | 319 | } |
317 | 320 | ||
318 | int Todo::percentComplete() const | 321 | int Todo::percentComplete() const |
319 | { | 322 | { |
320 | return mPercentComplete; | 323 | return mPercentComplete; |
321 | } | 324 | } |
322 | 325 | ||
323 | void Todo::setPercentComplete(int v) | 326 | void Todo::setPercentComplete(int v) |
324 | { | 327 | { |
325 | mPercentComplete = v; | 328 | mPercentComplete = v; |
329 | if ( v != 100 ) | ||
330 | mHasCompletedDate = false; | ||
326 | updated(); | 331 | updated(); |
327 | } | 332 | } |
328 | QDateTime Todo::getNextAlarmDateTime( bool * ok, int * offset ) const | 333 | QDateTime Todo::getNextAlarmDateTime( bool * ok, int * offset ) const |
329 | { | 334 | { |
330 | if ( isCompleted() || ! hasDueDate() || cancelled() ) { | 335 | if ( isCompleted() || ! hasDueDate() || cancelled() ) { |
331 | *ok = false; | 336 | *ok = false; |
332 | return QDateTime (); | 337 | return QDateTime (); |
333 | } | 338 | } |
334 | QDateTime incidenceStart; | 339 | QDateTime incidenceStart; |
335 | incidenceStart = dtDue(); | 340 | incidenceStart = dtDue(); |
336 | bool enabled = false; | 341 | bool enabled = false; |
337 | Alarm* alarm; | 342 | Alarm* alarm; |
338 | int off; | 343 | int off; |
339 | QDateTime alarmStart = QDateTime::currentDateTime().addDays( 3650 );; | 344 | QDateTime alarmStart = QDateTime::currentDateTime().addDays( 3650 );; |
340 | // if ( QDateTime::currentDateTime() > incidenceStart ){ | 345 | // if ( QDateTime::currentDateTime() > incidenceStart ){ |
341 | // *ok = false; | 346 | // *ok = false; |