move use of contextTask out of columns, into commands
This commit is contained in:
committed by
Tomas Babej
parent
e98b61f2b5
commit
6e9ad1048d
@@ -33,6 +33,8 @@
|
||||
#include <shared.h>
|
||||
#include <format.h>
|
||||
|
||||
extern Task* contextTask;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
CmdAnnotate::CmdAnnotate ()
|
||||
{
|
||||
@@ -82,6 +84,7 @@ int CmdAnnotate::execute (std::string&)
|
||||
task.identifier (true),
|
||||
task.get ("description"));
|
||||
|
||||
contextTask = &task;
|
||||
task.modify (Task::modAnnotate, true);
|
||||
|
||||
if (permission (before.diff (task) + question, filtered.size ()))
|
||||
@@ -102,6 +105,7 @@ int CmdAnnotate::execute (std::string&)
|
||||
auto siblings = Context::getContext ().tdb2.siblings (task);
|
||||
for (auto& sibling : siblings)
|
||||
{
|
||||
contextTask = &sibling;
|
||||
sibling.modify (Task::modAnnotate, true);
|
||||
Context::getContext ().tdb2.modify (sibling);
|
||||
++count;
|
||||
@@ -111,6 +115,7 @@ int CmdAnnotate::execute (std::string&)
|
||||
// Annotate the parent
|
||||
Task parent;
|
||||
Context::getContext ().tdb2.get (task.get ("parent"), parent);
|
||||
contextTask = &parent;
|
||||
parent.modify (Task::modAnnotate, true);
|
||||
Context::getContext ().tdb2.modify (parent);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user