mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Just set contextTask in Task::modify
Based on the observation that every command was setting contextTask immediately before calling `task.modify(..)`.
This commit is contained in:
parent
db26a28bf9
commit
2ea6dd627e
11 changed files with 5 additions and 42 deletions
|
@ -33,8 +33,6 @@
|
|||
#include <format.h>
|
||||
#include <main.h>
|
||||
|
||||
extern Task* contextTask;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
CmdPrepend::CmdPrepend ()
|
||||
{
|
||||
|
@ -84,7 +82,6 @@ int CmdPrepend::execute (std::string&)
|
|||
task.identifier (true),
|
||||
task.get ("description"));
|
||||
|
||||
contextTask = &task;
|
||||
task.modify (Task::modPrepend, true);
|
||||
|
||||
if (permission (before.diff (task) + question, filtered.size ()))
|
||||
|
@ -105,7 +102,6 @@ int CmdPrepend::execute (std::string&)
|
|||
std::vector <Task> siblings = Context::getContext ().tdb2.siblings (task);
|
||||
for (auto& sibling : siblings)
|
||||
{
|
||||
contextTask = &sibling;
|
||||
sibling.modify (Task::modPrepend, true);
|
||||
Context::getContext ().tdb2.modify (sibling);
|
||||
++count;
|
||||
|
@ -115,7 +111,6 @@ int CmdPrepend::execute (std::string&)
|
|||
// Prepend to the parent
|
||||
Task parent;
|
||||
Context::getContext ().tdb2.get (task.get ("parent"), parent);
|
||||
contextTask = &parent;
|
||||
parent.modify (Task::modPrepend, true);
|
||||
Context::getContext ().tdb2.modify (parent);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue