mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Merge branch 'master' into 2.3.0
Conflicts: AUTHORS CMakeLists.txt INSTALL NEWS cmake.h.in doc/man/task-faq.5.in package-config/osx/README scripts/utils/verify_l10n src/API.h src/Config.cpp src/Context.cpp src/DOM.cpp src/Hooks.cpp src/TransportShell.h src/commands/CmdDiagnostics.cpp src/commands/CmdShell.cpp src/commands/CmdVersion.cpp src/en-US.h src/shell/Readline.h src/wcwidth6.cpp test/CMakeLists.txt test/color.uda.t test/duration.t.cpp test/hook.on-launch.t test/template.t test/uuid.t
This commit is contained in:
commit
8af0a7f3ba
548 changed files with 13752 additions and 2435 deletions
|
@ -1,7 +1,7 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// taskwarrior - a command line task list manager.
|
||||
//
|
||||
// Copyright 2006-2012, Paul Beckingham, Federico Hernandez.
|
||||
// Copyright 2006-2013, Paul Beckingham, Federico Hernandez.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -35,6 +35,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <inttypes.h>
|
||||
#include <Context.h>
|
||||
#include <Duration.h>
|
||||
#include <main.h>
|
||||
#include <text.h>
|
||||
#include <util.h>
|
||||
|
@ -168,7 +169,7 @@ std::string taskDifferences (const Task& before, const Task& after)
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
std::string taskInfoDifferences (const Task& before, const Task& after, const std::string& dateformat)
|
||||
std::string taskInfoDifferences (const Task& before, const Task& after, const std::string& dateformat, long& last_timestamp, const long current_timestamp)
|
||||
{
|
||||
// Attributes are all there is, so figure the different attribute names
|
||||
// between before and after.
|
||||
|
@ -205,6 +206,12 @@ std::string taskInfoDifferences (const Task& before, const Task& after, const st
|
|||
out << format (STRING_FEEDBACK_ANN_DEL, before.get (*name))
|
||||
<< "\n";
|
||||
}
|
||||
else if (*name == "start")
|
||||
{
|
||||
out << format (STRING_FEEDBACK_ATT_DEL_DUR, ucFirst (*name),
|
||||
Duration(current_timestamp - last_timestamp).formatPrecise())
|
||||
<< "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
out << format (STRING_FEEDBACK_ATT_DEL, ucFirst (*name))
|
||||
|
@ -230,10 +237,15 @@ std::string taskInfoDifferences (const Task& before, const Task& after, const st
|
|||
<< "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (*name == "start")
|
||||
last_timestamp = current_timestamp;
|
||||
|
||||
out << format (STRING_FEEDBACK_ATT_WAS_SET,
|
||||
ucFirst (*name),
|
||||
renderAttribute (*name, after.get (*name), dateformat))
|
||||
<< "\n";
|
||||
}
|
||||
}
|
||||
|
||||
for (name = beforeAtts.begin (); name != beforeAtts.end (); ++name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue