From b7efb753b5fc849289d4bbf9ed3719281698d234 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Fri, 24 Oct 2014 23:00:06 -0400 Subject: [PATCH] Filter - Rewrote ::pendingOnly to work with CLI instead of Parser. --- src/Filter.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/Filter.cpp b/src/Filter.cpp index 1f2d03fb3..c1b52c1e0 100644 --- a/src/Filter.cpp +++ b/src/Filter.cpp @@ -224,16 +224,17 @@ bool Filter::pendingOnly () int countId = 0; int countOr = 0; int countXor = 0; - std::vector ::iterator i; - for (i = tree->_branches.begin (); i != tree->_branches.end (); ++i) + + std::vector ::iterator a; + for (a = context.cli._args.begin (); a != context.cli._args.end (); ++a) { - if ((*i)->hasTag ("FILTER")) + if (a->hasTag ("FILTER")) { - if ((*i)->hasTag ("ID")) ++countId; - if ((*i)->hasTag ("OP") && (*i)->attribute ("raw") == "or") ++countOr; - if ((*i)->hasTag ("OP") && (*i)->attribute ("raw") == "xor") ++countXor; - if ((*i)->hasTag ("ATTRIBUTE") && (*i)->attribute ("name") == "status") ++countStatus; - if ((*i)->hasTag ("ATTRIBUTE") && (*i)->attribute ("raw") == "pending") ++countPending; + if (a->hasTag ("ID")) ++countId; + if (a->hasTag ("OP") && a->attribute ("raw") == "or") ++countOr; + if (a->hasTag ("OP") && a->attribute ("raw") == "xor") ++countXor; + if (a->hasTag ("ATTRIBUTE") && a->attribute ("name") == "status") ++countStatus; + if ( a->attribute ("raw") == "pending") ++countPending; } }