mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
CmdAppend
- Converted from A3 modifications to Task::modify.
This commit is contained in:
parent
f2eb34d66a
commit
0551e70967
1 changed files with 4 additions and 7 deletions
|
@ -62,10 +62,7 @@ int CmdAppend::execute (std::string& output)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply the command line modifications to the new task.
|
// TODO Complain when no modifications are specified.
|
||||||
A3 modifications = context.a3.extract_modifications ();
|
|
||||||
if (!modifications.size ())
|
|
||||||
throw std::string (STRING_CMD_MODIFY_NEED_TEXT);
|
|
||||||
|
|
||||||
// Accumulated project change notifications.
|
// Accumulated project change notifications.
|
||||||
std::map <std::string, std::string> projectChanges;
|
std::map <std::string, std::string> projectChanges;
|
||||||
|
@ -80,7 +77,7 @@ int CmdAppend::execute (std::string& output)
|
||||||
task->id,
|
task->id,
|
||||||
task->get ("description"));
|
task->get ("description"));
|
||||||
|
|
||||||
modify_task_description_append (*task, modifications);
|
task->modify (Task::modAppend);
|
||||||
|
|
||||||
if (permission (*task, taskDifferences (before, *task) + question, filtered.size ()))
|
if (permission (*task, taskDifferences (before, *task) + question, filtered.size ()))
|
||||||
{
|
{
|
||||||
|
@ -100,7 +97,7 @@ int CmdAppend::execute (std::string& output)
|
||||||
std::vector <Task>::iterator sibling;
|
std::vector <Task>::iterator sibling;
|
||||||
for (sibling = siblings.begin (); sibling != siblings.end (); ++sibling)
|
for (sibling = siblings.begin (); sibling != siblings.end (); ++sibling)
|
||||||
{
|
{
|
||||||
modify_task_description_append (*sibling, modifications);
|
sibling->modify (Task::modAppend);
|
||||||
context.tdb2.modify (*sibling);
|
context.tdb2.modify (*sibling);
|
||||||
++count;
|
++count;
|
||||||
feedback_affected (STRING_CMD_APPEND_TASK_R, *sibling);
|
feedback_affected (STRING_CMD_APPEND_TASK_R, *sibling);
|
||||||
|
@ -109,7 +106,7 @@ int CmdAppend::execute (std::string& output)
|
||||||
// Append to the parent
|
// Append to the parent
|
||||||
Task parent;
|
Task parent;
|
||||||
context.tdb2.get (task->get ("parent"), parent);
|
context.tdb2.get (task->get ("parent"), parent);
|
||||||
modify_task_description_append (parent, modifications);
|
parent.modify (Task::modAppend);
|
||||||
context.tdb2.modify (parent);
|
context.tdb2.modify (parent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue