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