From 7aa101de58167b9234cdb879b9fbf5335166bf97 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 25 Jul 2015 09:28:55 -0400 Subject: [PATCH] Filter: Implemented ::hasModifications to detect command line modifications --- src/Filter.cpp | 10 ++++++++++ src/Filter.h | 1 + 2 files changed, 11 insertions(+) diff --git a/src/Filter.cpp b/src/Filter.cpp index ba950f704..6e430c499 100644 --- a/src/Filter.cpp +++ b/src/Filter.cpp @@ -198,6 +198,16 @@ void Filter::subset (std::vector & 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 diff --git a/src/Filter.h b/src/Filter.h index 80c84487a..21f76fd44 100644 --- a/src/Filter.h +++ b/src/Filter.h @@ -42,6 +42,7 @@ public: void subset (const std::vector &, std::vector &, bool applyContext = true); void subset (std::vector &, bool applyContext = true); + bool hasModifications (); bool pendingOnly (); void safety (); void disableSafety ();