summaryrefslogtreecommitdiffabout
path: root/libkcal/todo.cpp
Side-by-side diff
Diffstat (limited to 'libkcal/todo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/todo.cpp7
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
@@ -279,25 +279,28 @@ QString Todo::statusStr() const
}
#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);
}
@@ -314,24 +317,26 @@ 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;