Edit - reenabled
- Reenabled the edit command with the new filtering mechanism.
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user