diff --git a/src/Hooks.cpp b/src/Hooks.cpp index 5bbb2309a..c42481543 100644 --- a/src/Hooks.cpp +++ b/src/Hooks.cpp @@ -242,6 +242,24 @@ void Hooks::onModify (const Task& before, Task& after) context.timer_hooks.stop (); } +//////////////////////////////////////////////////////////////////////////////// +std::vector Hooks::scripts (const std::string& event) +{ + std::vector matching; + std::vector ::iterator i; + for (i = _scripts.begin (); i != _scripts.end (); ++i) + { + if (i->find ("/" + event) != std::string::npos) + { + File script (*i); + if (script.executable ()) + matching.push_back (*i); + } + } + + return matching; +} + //////////////////////////////////////////////////////////////////////////////// int Hooks::execute ( const std::string& command, diff --git a/src/Hooks.h b/src/Hooks.h index 6ed630f86..d6501da84 100644 --- a/src/Hooks.h +++ b/src/Hooks.h @@ -46,6 +46,7 @@ public: void onModify (const Task&, Task&); private: + std::vector scripts (const std::string&); int execute (const std::string&, const std::string&, std::string&); private: