Edit - reenabled

- Reenabled the edit command with the new filtering mechanism.
This commit is contained in:
Paul Beckingham
2011-07-02 09:59:50 -04:00
parent f1b5999983
commit 32392b8650

View File

@@ -56,29 +56,24 @@ int CmdEdit::execute (std::string& output)
{ {
int rc = 0; int rc = 0;
/* // Get all the tasks.
std::stringstream out;
std::vector <Task> tasks; std::vector <Task> tasks;
context.tdb.lock (context.config.getBoolean ("locking")); context.tdb.lock (context.config.getBoolean ("locking"));
handleRecurrence (); handleRecurrence ();
Filter filter; context.tdb.load (tasks);
context.tdb.loadPending (tasks, filter);
// Filter sequence. // Apply filter.
std::vector <Task> all = tasks; std::vector <Task> filtered;
context.filter.applySequence (tasks, context.sequence); filter (tasks, filtered);
// Find number of matching tasks. Skip recurring parent tasks.
std::vector <Task>::iterator task; std::vector <Task>::iterator task;
for (task = tasks.begin (); task != tasks.end (); ++task) for (task = filtered.begin (); task != filtered.end (); ++task)
if (editFile (*task)) if (editFile (*task))
context.tdb.update (*task); context.tdb.update (*task);
context.tdb.commit (); context.tdb.commit ();
context.tdb.unlock (); context.tdb.unlock ();
output = out.str ();
*/
return rc; return rc;
} }