Display duration of each activity session

This commit is contained in:
Justin Forest 2012-12-17 17:09:16 +04:00 committed by Paul Beckingham
parent 745d24e124
commit c0fbfcc58c
4 changed files with 15 additions and 4 deletions

View file

@ -381,7 +381,7 @@ int CmdInfo::execute (std::string& output)
std::string previous;
std::string current;
unsigned int i = 0;
long total_time = 0;
long total_time = 0, last_timestamp = 0;
while (i < undo.size ())
{
when = undo[i++];
@ -403,7 +403,7 @@ int CmdInfo::execute (std::string& output)
Task before (previous.substr (4));
Task after (current.substr (4));
journal.set (row, 1, taskInfoDifferences (before, after, dateformat));
journal.set (row, 1, taskInfoDifferences (before, after, dateformat, last_timestamp, timestamp.toEpoch()));
// calculate the total active time
if (before.get ("start") == ""