From 28ceeac796c456d08b1fe7f36b88c929d256380b Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 8 Nov 2008 23:48:19 -0500 Subject: [PATCH] - Beginnings of the "task list pri:!H" inverse filtering capability. Doesn't work, and is commented out for now. Need a better approach because of the priority attribute validation of "!H" failing, and the Unix shell interpreting "!", thus requiring an escape, which makes the command ("task list pri:\!H") ugly. --- src/report.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/report.cpp b/src/report.cpp index 869786be6..ac19825a4 100644 --- a/src/report.cpp +++ b/src/report.cpp @@ -86,9 +86,40 @@ void filter (std::vector& all, T& task) if (a->second.length () <= refTask.getAttribute (a->first).length ()) if (a->second == refTask.getAttribute (a->first).substr (0, a->second.length ())) ++matches; +/* + TODO Attempt at allowing "pri:!H", thwarted by a lack of coffee and the + validation of "!H" as a priority value. To be revisited soon. + { + if (a->second[0] == '!') // Inverted search. + { + if (a->second.substr (1, std::string::npos) != refTask.getAttribute (a->first).substr (0, a->second.length ())) + ++matches; + } + else + { + if (a->second == refTask.getAttribute (a->first).substr (0, a->second.length ())) + ++matches; + } + } +*/ } else if (a->second == refTask.getAttribute (a->first)) ++matches; +/* + else + { + if (a->second[0] == '!') // Inverted search. + { + if (a->second.substr (1, std::string::npos) != refTask.getAttribute (a->first)) + ++matches; + } + else + { + if (a->second == refTask.getAttribute (a->first)) + ++matches; + } + } +*/ } if (matches == attrList.size ())