summaryrefslogtreecommitdiffabout
path: root/korganizer/kotodoview.cpp
authorzautrix <zautrix>2005-01-30 12:08:19 (UTC)
committer zautrix <zautrix>2005-01-30 12:08:19 (UTC)
commit1bcef8b3f53419e7155e0862ad61e3e419763d70 (patch) (side-by-side diff)
tree166b82db7bc30b7d55b042bd37bb92facea6cdf2 /korganizer/kotodoview.cpp
parent446ea98a9f6550c4a3e64bcfc6aab8e8b58776e8 (diff)
downloadkdepimpi-1bcef8b3f53419e7155e0862ad61e3e419763d70.zip
kdepimpi-1bcef8b3f53419e7155e0862ad61e3e419763d70.tar.gz
kdepimpi-1bcef8b3f53419e7155e0862ad61e3e419763d70.tar.bz2
fixes
Diffstat (limited to 'korganizer/kotodoview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kotodoview.cpp29
1 files changed, 19 insertions, 10 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 14e8b5c..902f3f4 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -858,15 +858,24 @@ void KOTodoView::setNewPriority(int index)
void KOTodoView::setNewPercentage(int index)
{
- if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) {
- if (mPercentage[index] == 100) {
- mActiveItem->todo()->setCompleted(QDateTime::currentDateTime());
- } else {
- mActiveItem->todo()->setCompleted(false);
+ 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 {
+ mActiveItem->todo()->setCompleted(false);
+ }
+ mActiveItem->todo()->setPercentComplete(mPercentage[index]);
+ mActiveItem->construct();
+ todoModified (mActiveItem->todo (), KOGlobals::COMPLETION_MODIFIED);
+ mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 );
}
- mActiveItem->todo()->setPercentComplete(mPercentage[index]);
- mActiveItem->construct();
- todoModified (mActiveItem->todo (), KOGlobals::COMPLETION_MODIFIED);
- mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 );
- }
}