CmdProjects

- Converted from A3 to Filter.
This commit is contained in:
Paul Beckingham 2014-05-24 23:52:51 -04:00
parent 510be02b64
commit 82ccc80e9a

View file

@ -28,6 +28,7 @@
#include <algorithm>
#include <sstream>
#include <Context.h>
#include <Filter.h>
#include <ViewText.h>
#include <text.h>
#include <util.h>
@ -64,11 +65,11 @@ int CmdProjects::execute (std::string& output)
tasks.push_back (*task);
}
context.tdb2.commit ();
// Apply filter.
// Apply the filter.
Filter filter;
std::vector <Task> filtered;
filter (tasks, filtered);
filter.subset (tasks, filtered);
context.tdb2.commit ();
int quantity = filtered.size ();
@ -179,11 +180,11 @@ int CmdCompletionProjects::execute (std::string& output)
tasks.push_back (*task);
}
context.tdb2.commit ();
// Apply filter.
// Apply the filter.
Filter filter;
std::vector <Task> filtered;
filter (tasks, filtered);
filter.subset (tasks, filtered);
context.tdb2.commit ();
// Scan all the tasks for their project name, building a map using project
// names as keys.