Bug 143724

Summary: Auto tracking system still tracks the task after it was marked as complete
Product: [Applications] ktimetracker Reporter: Nicu Hodos <nicu>
Component: generalAssignee: Thorsten Staerk <dev>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:

Description Nicu Hodos 2007-04-02 12:54:46 UTC
Version:           1.6.0 (using KDE 3.5.6, Kubuntu (edgy) 4:3.5.6-0ubuntu1~edgy1)
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.17-11-386

I know this was reported before as bug http://bugs.kde.org/show_bug.cgi?id=91732, but I don't think these 2 are duplicates. That's because I downloaded the source code for the version 1.6.0 and I see the patch suggested for bug 91732 is there.

Here is a sample of how to reproduce this, for 2 desktops case:
1) from desktop 1 create a task and set it to auto tracking in desktop 2
2) switch to desktop 2, the task will start tracking
3) mark it as complete, it will stop tracking
4) switch to desktop 1, nothing happends, as expected
5) switch back to desktop 2, the task will begin tracking again
Comment 1 Thorsten Staerk 2007-04-02 20:41:15 UTC
I can reproduce this and it is a bug.
Comment 2 Thorsten Staerk 2007-04-06 14:37:46 UTC
I bet this is the solution:

Index: taskview.cpp
===================================================================
--- taskview.cpp        (revision 651040)
+++ taskview.cpp        (working copy)
@@ -383,6 +383,7 @@
 void TaskView::startTimerFor(Task* task, QDateTime startTime )
 {
   kdDebug(5970) << "Entering TaskView::startTimerFor" << endl;
+  if (task->isComplete()) return;
   if (save()==QString())
   {
     if (task != 0 && activeTasks.findRef(task) == -1)
Index: task.cpp
===================================================================
--- task.cpp    (revision 651040)
+++ task.cpp    (working copy)
@@ -99,7 +99,6 @@
 {
   kdDebug(5970) << "Entering Task::setRunning" << endl;
   if ( on ) {
-    if (isComplete()) return; // don't start if its marked complete
     if (!_timer->isActive()) {
       _timer->start(1000);
       storage->startTimer(this);
Comment 3 Thorsten Staerk 2007-04-06 15:13:27 UTC
wrong. I bet this is the problem:

  connect( _desktopTracker, SIGNAL( reachedtActiveDesktop( Task* ) ),
           this, SLOT( startTimerFor(Task*) ));
Comment 4 Thorsten Staerk 2007-08-28 21:21:08 UTC

*** This bug has been marked as a duplicate of 149302 ***