From b4d09d1c308fdc956798d830e09b7193a111e6c0 Mon Sep 17 00:00:00 2001 From: Louis-Claude Canon Date: Tue, 24 Apr 2012 23:36:04 -0400 Subject: [PATCH] Bug #987 - Fixed bug #987, so that total active time does not continue to accumulate after an active task is completed. Signed-off-by: Paul Beckingham --- ChangeLog | 2 ++ src/commands/CmdInfo.cpp | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9ddf7c9a1..da5b9a8cb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -22,6 +22,8 @@ Bugs Spiegl). + Fixed bug #986, so that the 'info' report uses the correct date format (thanks to Louis-Claude Canon). + + Applied patch for bug #987, so that total active time does not continue to + accumulate after an active task is completed (thanks to Louis-Claude Canon). + Fixed bug #988, updating the documentation so that 'undo.data' usage is more clearly stated (thanks to Louis-Claude Canon). + Fixed grammar in feedback string (thanks to Uli Martens). diff --git a/src/commands/CmdInfo.cpp b/src/commands/CmdInfo.cpp index 52d0d269d..04d8e494d 100644 --- a/src/commands/CmdInfo.cpp +++ b/src/commands/CmdInfo.cpp @@ -401,10 +401,13 @@ int CmdInfo::execute (std::string& output) // task started total_time -= timestamp.toEpoch (); } - else if (before.get ("start") != "" - && after.get ("start") == "") + else if (((before.get ("start") != "" && + after.get ("start") == "") || + (before.get ("status") != "completed" && + after.get ("status") == "completed")) && + total_time < 0) { - // task stopped + // task stopped or done total_time += timestamp.toEpoch (); } }