- Stubbed new ::onAdd and ::onModify interfaces.
This commit is contained in:
Paul Beckingham 2014-09-14 15:42:47 -04:00
parent 7b617a7b6e
commit ab72cdad4d
3 changed files with 15 additions and 10 deletions

View file

@ -570,9 +570,7 @@ void TDB2::add (Task& task, bool add_to_backlog /* = true */)
// Create a vector tasks, as hooks can cause them to multiply.
std::vector <Task> changes;
changes.push_back (task);
// TODO call hooks.
// context.hooks.onAdd (changes);
context.hooks.onAdd (changes);
update (uuid, task, add_to_backlog, changes);
}
@ -584,12 +582,14 @@ void TDB2::modify (Task& task, bool add_to_backlog /* = true */)
task.validate (false);
std::string uuid = task.get ("uuid");
// Get the unmodified task as reference, so the hook can compare.
Task original;
get (uuid, original);
// Create a vector tasks, as hooks can cause them to multiply.
std::vector <Task> changes;
changes.push_back (task);
// TODO call hooks.
// context.hooks.onModify (changes);
context.hooks.onModify (original, changes);
update (uuid, task, add_to_backlog, changes);
}