- 'task projects' discard now newly deleted tasks and it includes only filtered
  tasks for its summary.
This commit is contained in:
Louis-Claude Canon 2012-07-27 11:30:24 +02:00 committed by Paul Beckingham
parent 154d99385a
commit 0857b451d6
3 changed files with 73 additions and 2 deletions

View file

@ -65,14 +65,14 @@ int CmdProjects::execute (std::string& output)
tasks.push_back (*task);
}
int quantity = tasks.size ();
context.tdb2.commit ();
// Apply filter.
std::vector <Task> filtered;
filter (tasks, filtered);
int quantity = filtered.size ();
std::stringstream out;
// Scan all the tasks for their project name, building a map using project
@ -88,6 +88,12 @@ int CmdProjects::execute (std::string& output)
std::vector <Task>::iterator task;
for (task = filtered.begin (); task != filtered.end (); ++task)
{
if (task->getStatus () == Task::deleted)
{
--quantity;
continue;
}
project = task->get ("project");
priority = task->get ("priority");