mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-09-09 18:50:39 +02:00
Task: Improved method signature
This commit is contained in:
parent
cfc3e098c1
commit
5193f7d03e
10 changed files with 21 additions and 49 deletions
|
@ -90,8 +90,7 @@ int CmdDenotate::execute (std::string&)
|
|||
{
|
||||
Task before (task);
|
||||
|
||||
std::map <std::string, std::string> annotations;
|
||||
task.getAnnotations (annotations);
|
||||
auto annotations = task.getAnnotations ();
|
||||
|
||||
if (annotations.size () == 0)
|
||||
throw std::string (STRING_CMD_DENO_NONE);
|
||||
|
|
|
@ -245,9 +245,7 @@ std::string CmdEdit::formatTask (Task task, const std::string& dateformat)
|
|||
<< "# " << STRING_EDIT_HEADER_14 << '\n'
|
||||
<< "# " << STRING_EDIT_HEADER_15 << '\n';
|
||||
|
||||
std::map <std::string, std::string> annotations;
|
||||
task.getAnnotations (annotations);
|
||||
for (auto& anno : annotations)
|
||||
for (auto& anno : task.getAnnotations ())
|
||||
{
|
||||
Datetime dt (strtol (anno.first.substr (11).c_str (), NULL, 10));
|
||||
before << " Annotation: " << dt.toString (dateformat)
|
||||
|
|
|
@ -134,9 +134,7 @@ int CmdInfo::execute (std::string& output)
|
|||
std::string description = task.get ("description");
|
||||
int indent = context.config.getInteger ("indent.annotation");
|
||||
|
||||
std::map <std::string, std::string> annotations;
|
||||
task.getAnnotations (annotations);
|
||||
for (auto& anno : annotations)
|
||||
for (auto& anno : task.getAnnotations ())
|
||||
description += '\n'
|
||||
+ std::string (indent, ' ')
|
||||
+ Datetime (anno.first.substr (11)).toString (dateformatanno)
|
||||
|
|
|
@ -140,10 +140,7 @@ int CmdStats::execute (std::string& output)
|
|||
daysPending += (now.toEpoch () - entry) / 86400.0;
|
||||
|
||||
descLength += task.get ("description").length ();
|
||||
|
||||
std::map <std::string, std::string> annotations;
|
||||
task.getAnnotations (annotations);
|
||||
annotationsT += annotations.size ();
|
||||
annotationsT += task.getAnnotations ().size ();
|
||||
|
||||
auto tags = task.getTags ();
|
||||
if (tags.size ())
|
||||
|
|
|
@ -142,9 +142,7 @@ int CmdTimesheet::execute (std::string& output)
|
|||
std::string description = task.get ("description");
|
||||
int indent = context.config.getInteger ("indent.annotation");
|
||||
|
||||
std::map <std::string, std::string> annotations;
|
||||
task.getAnnotations (annotations);
|
||||
for (auto& ann : annotations)
|
||||
for (auto& ann : task.getAnnotations ())
|
||||
description += '\n'
|
||||
+ std::string (indent, ' ')
|
||||
+ Datetime (ann.first.substr (11)).toString (context.config.get ("dateformat"))
|
||||
|
@ -198,9 +196,7 @@ int CmdTimesheet::execute (std::string& output)
|
|||
std::string description = task.get ("description");
|
||||
int indent = context.config.getInteger ("indent.annotation");
|
||||
|
||||
std::map <std::string, std::string> annotations;
|
||||
task.getAnnotations (annotations);
|
||||
for (auto& ann : annotations)
|
||||
for (auto& ann : task.getAnnotations ())
|
||||
description += '\n'
|
||||
+ std::string (indent, ' ')
|
||||
+ Datetime (ann.first.substr (11)).toString (context.config.get ("dateformat"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue