- 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.
This commit is contained in:
Paul Beckingham 2008-11-08 23:48:19 -05:00
parent ecdfb31553
commit 28ceeac796

View file

@ -86,9 +86,40 @@ void filter (std::vector<T>& 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 ())