From e924468de6ec592b6ad9410e8c6aca6d669dead4 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 27 Apr 2014 10:17:34 -0700 Subject: [PATCH] CmdCount - Converted from Command::filter to Filter::subset. --- src/A3t.cpp | 4 ++-- src/args.cpp | 1 - src/commands/CmdCount.cpp | 4 +++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/A3t.cpp b/src/A3t.cpp index 56263cd18..7bc77fb39 100644 --- a/src/A3t.cpp +++ b/src/A3t.cpp @@ -530,7 +530,7 @@ const std::string A3t::getFilterExpression () if ((*i)->hasTag ("FILTER") && ! (*i)->hasTag ("PSEUDO")) { // Two consecutive FILTER, non-OP arguments that are not "(" or ")" need - // an "AND" operator inserted between them. + // an "and" operator inserted between them. // // ) --> ) and // ( --> ( @@ -541,7 +541,7 @@ const std::string A3t::getFilterExpression () (((*prev)->hasTag ("FILTER") && ! (*prev)->hasTag ("OP")) || (*prev)->attribute ("raw") == ")") && (! (*i)->hasTag ("OP") || (*i)->attribute ("raw") == "(")) { - filter += " AND"; + filter += " and"; } if ((*i)->hasTag ("ID")) diff --git a/src/args.cpp b/src/args.cpp index 21d9eabef..b1d94c89b 100644 --- a/src/args.cpp +++ b/src/args.cpp @@ -73,7 +73,6 @@ int main (int argc, const char** argv) a3t.entity ("report", "unblocked"); a3t.entity ("report", "waiting"); - // Read-only commands. a3t.entity ("readcmd", "export"); a3t.entity ("readcmd", "info"); diff --git a/src/commands/CmdCount.cpp b/src/commands/CmdCount.cpp index 009c34ea6..158cc587a 100644 --- a/src/commands/CmdCount.cpp +++ b/src/commands/CmdCount.cpp @@ -26,6 +26,7 @@ #include #include +#include #include #include #include @@ -49,7 +50,8 @@ int CmdCount::execute (std::string& output) // Apply filter. handleRecurrence (); std::vector filtered; - filter (filtered); + Filter filter; + filter.subset (filtered); context.tdb2.commit (); // Find number of matching tasks. Skip recurring parent tasks.