mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
TDB2
- Integrated hooks to TF2::add_task and TF2::modify_task.
This commit is contained in:
parent
631e4176c7
commit
68436d0d50
1 changed files with 12 additions and 5 deletions
17
src/TDB2.cpp
17
src/TDB2.cpp
|
@ -134,10 +134,13 @@ bool TF2::get (const std::string& uuid, Task& task)
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
void TF2::add_task (const Task& task)
|
||||
{
|
||||
_tasks.push_back (task); // For subsequent queries
|
||||
_added_tasks.push_back (task); // For commit/synch
|
||||
Task hookTask (task);
|
||||
context.hooks.onAdd (hookTask);
|
||||
|
||||
/* TODO handle 'add' and 'log'.
|
||||
_tasks.push_back (hookTask); // For subsequent queries
|
||||
_added_tasks.push_back (hookTask); // For commit/synch
|
||||
|
||||
/* TODO handle 'add' and 'log'?
|
||||
int id = context.tdb2.next_id ();
|
||||
_I2U[id] = task.get ("uuid");
|
||||
_U2I[task.get ("uuid")] = id;
|
||||
|
@ -156,9 +159,13 @@ bool TF2::modify_task (const Task& task)
|
|||
{
|
||||
if (i->get ("uuid") == uuid)
|
||||
{
|
||||
*i = task;
|
||||
_modified_tasks.push_back (task);
|
||||
Task hookTask (task);
|
||||
context.hooks.onModify (*i, hookTask);
|
||||
|
||||
*i = hookTask;
|
||||
_modified_tasks.push_back (hookTask);
|
||||
_dirty = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue