- Removed all obsolete hooks, except from commands.cpp, which is being
  worked on in parallel.
- Implemented new on-launch and on-exit unit tests.
This commit is contained in:
Paul Beckingham
2011-04-17 21:09:58 -04:00
parent 2f4efb28d6
commit 48eb4757f8
15 changed files with 2816 additions and 3246 deletions

View File

@@ -652,32 +652,27 @@ int handleEdit (std::string& outs)
{
int rc = 0;
if (context.hooks.trigger ("pre-edit-command"))
{
std::stringstream out;
std::stringstream out;
std::vector <Task> tasks;
context.tdb.lock (context.config.getBoolean ("locking"));
handleRecurrence ();
Filter filter;
context.tdb.loadPending (tasks, filter);
std::vector <Task> tasks;
context.tdb.lock (context.config.getBoolean ("locking"));
handleRecurrence ();
Filter filter;
context.tdb.loadPending (tasks, filter);
// Filter sequence.
std::vector <Task> all = tasks;
context.filter.applySequence (tasks, context.sequence);
// Filter sequence.
std::vector <Task> all = tasks;
context.filter.applySequence (tasks, context.sequence);
std::vector <Task>::iterator task;
for (task = tasks.begin (); task != tasks.end (); ++task)
if (editFile (*task))
context.tdb.update (*task);
std::vector <Task>::iterator task;
for (task = tasks.begin (); task != tasks.end (); ++task)
if (editFile (*task))
context.tdb.update (*task);
context.tdb.commit ();
context.tdb.unlock ();
outs = out.str ();
context.hooks.trigger ("post-edit-command");
}
context.tdb.commit ();
context.tdb.unlock ();
outs = out.str ();
return rc;
}