Filter: Implemented ::hasModifications to detect command line modifications

This commit is contained in:
Paul Beckingham 2015-07-25 09:28:55 -04:00
parent 6510026189
commit 7aa101de58
2 changed files with 11 additions and 0 deletions

View file

@ -198,6 +198,16 @@ void Filter::subset (std::vector <Task>& output, bool applyContext /* = true */)
context.timer_filter.stop ();
}
////////////////////////////////////////////////////////////////////////////////
bool Filter::hasModifications ()
{
for (auto& a : context.cli2._args)
if (a.hasTag ("MODIFICATION"))
return true;
return false;
}
////////////////////////////////////////////////////////////////////////////////
// If the filter contains no 'or', 'xor' or 'not' operators, and only includes
// status values 'pending', 'waiting' or 'recurring', then the filter is

View file

@ -42,6 +42,7 @@ public:
void subset (const std::vector <Task>&, std::vector <Task>&, bool applyContext = true);
void subset (std::vector <Task>&, bool applyContext = true);
bool hasModifications ();
bool pendingOnly ();
void safety ();
void disableSafety ();