mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Hooks
- ::onExit now provides a set of all changeѕ tasks to the hook script, in read-only form.
This commit is contained in:
parent
d0fd3bac4a
commit
bfc6e38851
3 changed files with 39 additions and 3 deletions
26
src/TDB2.cpp
26
src/TDB2.cpp
|
@ -671,6 +671,8 @@ void TDB2::commit ()
|
|||
dump ();
|
||||
context.timer_commit.start ();
|
||||
|
||||
gather_changes ();
|
||||
|
||||
pending.commit ();
|
||||
completed.commit ();
|
||||
undo.commit ();
|
||||
|
@ -688,6 +690,30 @@ void TDB2::commit ()
|
|||
context.timer_commit.stop ();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void TDB2::gather_changes ()
|
||||
{
|
||||
_changes.clear ();
|
||||
std::vector <Task>::iterator i;
|
||||
for (i = pending._added_tasks.begin (); i != pending._added_tasks.end (); ++i)
|
||||
_changes.push_back (*i);
|
||||
|
||||
for (i = pending._modified_tasks.begin (); i != pending._modified_tasks.end (); ++i)
|
||||
_changes.push_back (*i);
|
||||
|
||||
for (i = completed._added_tasks.begin (); i != completed._added_tasks.end (); ++i)
|
||||
_changes.push_back (*i);
|
||||
|
||||
for (i = completed._modified_tasks.begin (); i != completed._modified_tasks.end (); ++i)
|
||||
_changes.push_back (*i);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void TDB2::get_changes (std::vector <Task>& changes)
|
||||
{
|
||||
changes = _changes;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void TDB2::revert ()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue