Bug 149302 - KTimeTracker: Marking task done does not stop the time (includes patch)
Summary: KTimeTracker: Marking task done does not stop the time (includes patch)
Status: RESOLVED FIXED
Alias: None
Product: ktimetracker
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Thorsten Staerk
URL:
Keywords:
: 143724 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-08-28 14:42 UTC by Christian Mandery
Modified: 2007-08-28 21:21 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Mandery 2007-08-28 14:42:57 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources

Setup:
- Create task
- Start task
- Task runs
- Mark task done by clicking the box
- Task is now marked 100% complete but keeps running

Please apply my simple patch that should fix the problem:

--- taskview.cpp        2007-08-28 14:41:30.000000000 +0200
+++ taskview.cpp.new    2007-08-28 14:41:26.000000000 +0200
@@ -386,6 +386,7 @@
         if (task->isComplete()) {
           task->setPercentComplete( 0, d->mStorage );
         } else {
+          stopTimerFor( task );  // Use our own method instead of calling setRunning() directly
           task->setPercentComplete( 100, d->mStorage );
         }
Comment 1 Thorsten Staerk 2007-08-28 16:32:05 UTC
confirmed, this is a bug.
Comment 2 Thorsten Staerk 2007-08-28 16:43:48 UTC
SVN commit 705768 by tstaerk:

Do not track a complete task. Applying patch by Christian Mandery.
CCBUGS:149302


 M  +1 -0      taskview.cpp  


--- trunk/KDE/kdepim/ktimetracker/taskview.cpp #705767:705768
@@ -388,6 +388,7 @@
         if (task->isComplete()) {
           task->setPercentComplete( 0, d->mStorage );
         } else {
+          stopTimerFor( task );  // Use our own method instead of calling setRunning() directly
           task->setPercentComplete( 100, d->mStorage );
         }
         
Comment 3 Thorsten Staerk 2007-08-28 18:45:24 UTC
SVN commit 705813 by tstaerk:

backport 705768
CCBUGS:149302


 M  +1 -1      task.cpp  


--- branches/KDE/3.5/kdepim/karm/task.cpp #705812:705813
@@ -160,7 +160,7 @@
   else
     _percentcomplete = percent;
 
-  if (isRunning() && _percentcomplete==100) setRunning(false, storage);
+  if (isRunning() && _percentcomplete==100) taskView()->stopTimerFor(this);
 
   setPixmapProgress();
 
Comment 4 Thorsten Staerk 2007-08-28 18:51:02 UTC
SVN commit 705814 by tstaerk:

Do not track a task that has been marked as complete in no matter what
way.
BUGS:149302


 M  +1 -1      task.cpp  
 M  +0 -1      taskview.cpp  


--- trunk/KDE/kdepim/ktimetracker/task.cpp #705813:705814
@@ -242,7 +242,7 @@
   else
     d->mPercentComplete = percent;
 
-  if (isRunning() && d->mPercentComplete==100) setRunning(false, storage);
+  if (isRunning() && d->mPercentComplete==100) taskView()->stopTimerFor(this);
 
   setPixmapProgress();
 
--- trunk/KDE/kdepim/ktimetracker/taskview.cpp #705813:705814
@@ -388,7 +388,6 @@
         if (task->isComplete()) {
           task->setPercentComplete( 0, d->mStorage );
         } else {
-          stopTimerFor( task );  // Use our own method instead of calling setRunning() directly
           task->setPercentComplete( 100, d->mStorage );
         }
         
Comment 5 Thorsten Staerk 2007-08-28 21:21:10 UTC
*** Bug 143724 has been marked as a duplicate of this bug. ***