author | zautrix <zautrix> | 2005-01-30 01:41:12 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-30 01:41:12 (UTC) |
commit | 949c6e28c83668176fd9c29e12668322c6ae627f (patch) (side-by-side diff) | |
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 @@ -267,83 +267,88 @@ QString Todo::statusStr() const break; case DECLINED: return QString("DECLINED"); break; case COMPLETED: return QString("COMPLETED"); break; case DELEGATED: return QString("DELEGATED"); break; } return QString(""); } #endif bool Todo::isCompleted() const { if (mPercentComplete == 100) return true; else return false; } void Todo::setCompleted(bool completed) { if (completed) mPercentComplete = 100; - else mPercentComplete = 0; + else { + mPercentComplete = 0; + mHasCompletedDate = false; + } updated(); } QDateTime Todo::completed() const { return mCompleted; } QString Todo::completedStr() const { return KGlobal::locale()->formatDateTime(mCompleted); } void Todo::setCompleted(const QDateTime &completed) { mHasCompletedDate = true; mPercentComplete = 100; mCompleted = getEvenTime(completed); updated(); } bool Todo::hasCompletedDate() const { return mHasCompletedDate; } int Todo::percentComplete() const { return mPercentComplete; } void Todo::setPercentComplete(int v) { mPercentComplete = v; + if ( v != 100 ) + mHasCompletedDate = false; updated(); } QDateTime Todo::getNextAlarmDateTime( bool * ok, int * offset ) const { if ( isCompleted() || ! hasDueDate() || cancelled() ) { *ok = false; return QDateTime (); } QDateTime incidenceStart; incidenceStart = dtDue(); bool enabled = false; Alarm* alarm; int off; QDateTime alarmStart = QDateTime::currentDateTime().addDays( 3650 );; // if ( QDateTime::currentDateTime() > incidenceStart ){ // *ok = false; // return incidenceStart; // } for (QPtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) { if (alarm->enabled()) { if ( alarm->hasTime () ) { if ( alarm->time() < alarmStart ) { alarmStart = alarm->time(); enabled = true; |