-rw-r--r-- | korganizer/kotodoview.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 14e8b5c..902f3f4 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp @@ -858,6 +858,15 @@ void KOTodoView::setNewPriority(int index) void KOTodoView::setNewPercentage(int index) { if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { + + if ( mPercentage[index] == 100 && !mActiveItem->isOn() ) { + mActiveItem->setOn( true ); + return; + } else if ( mPercentage[index] != 100 && mActiveItem->isOn() ) { + KOTodoViewItem* par = (static_cast<KOTodoViewItem*>(mActiveItem->parent())); + if ( par && par->isOn() ) + par->setOn( false ); + } if (mPercentage[index] == 100) { mActiveItem->todo()->setCompleted(QDateTime::currentDateTime()); } else { |