Commit 58d2f731 authored by Glen Ditchfield's avatar Glen Ditchfield 🐛 Committed by Glen Ditchfield
Browse files

Allow change of completion percentage of completed to-dos

If a non-recurring to-do has been completed, attempting to reduce its
completion percentage has no effect, because `Todo::setPercentComplete(0)`
alone is not sufficient.  This patch brute-forces all completion-related
fields.
BUG: 397721
parent 5a2cc741
Pipeline #69337 failed with stage
in 4 minutes and 59 seconds
......@@ -111,10 +111,14 @@ void IncidenceCompletionPriority::save(const KCalendarCore::Incidence::Ptr &inci
todo->setPercentComplete(d->mOrigPercentCompleted);
} else {
const int pct = d->mUi->mCompletionSlider->value();
todo->setPercentComplete(pct);
if (pct >= 100) {
todo->setCompleted(QDateTime::currentDateTimeUtc());
todo->setStatus(KCalendarCore::Incidence::StatusCompleted);
} else {
todo->setCompleted(false);
todo->setStatus(pct <= 0 ? KCalendarCore::Incidence::StatusNone : KCalendarCore::Incidence::StatusInProcess);
}
todo->setPercentComplete(pct);
}
todo->setPriority(d->mUi->mPriorityCombo->currentIndex());
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment