summaryrefslogtreecommitdiffabout
path: root/korganizer/kotodoview.cpp
Unidiff
Diffstat (limited to 'korganizer/kotodoview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/kotodoview.cpp9
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
@@ -855,12 +855,21 @@ void KOTodoView::setNewPriority(int index)
855 } 855 }
856} 856}
857 857
858void KOTodoView::setNewPercentage(int index) 858void KOTodoView::setNewPercentage(int index)
859{ 859{
860 if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { 860 if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) {
861
862 if ( mPercentage[index] == 100 && !mActiveItem->isOn() ) {
863 mActiveItem->setOn( true );
864 return;
865 } else if ( mPercentage[index] != 100 && mActiveItem->isOn() ) {
866 KOTodoViewItem* par = (static_cast<KOTodoViewItem*>(mActiveItem->parent()));
867 if ( par && par->isOn() )
868 par->setOn( false );
869 }
861 if (mPercentage[index] == 100) { 870 if (mPercentage[index] == 100) {
862 mActiveItem->todo()->setCompleted(QDateTime::currentDateTime()); 871 mActiveItem->todo()->setCompleted(QDateTime::currentDateTime());
863 } else { 872 } else {
864 mActiveItem->todo()->setCompleted(false); 873 mActiveItem->todo()->setCompleted(false);
865 } 874 }
866 mActiveItem->todo()->setPercentComplete(mPercentage[index]); 875 mActiveItem->todo()->setPercentComplete(mPercentage[index]);