From 82ccc80e9aa28cd4bbbbd71949c2171b9783d912 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 24 May 2014 23:52:51 -0400 Subject: [PATCH] CmdProjects - Converted from A3 to Filter. --- src/commands/CmdProjects.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/commands/CmdProjects.cpp b/src/commands/CmdProjects.cpp index 0b18b70eb..5ab3ac607 100644 --- a/src/commands/CmdProjects.cpp +++ b/src/commands/CmdProjects.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -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 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 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.