mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-31 17:03:30 +02:00
Enhancement - Hooks
- Added timing information for event trigger calls.
This commit is contained in:
parent
98f4e22950
commit
79050c29d7
1 changed files with 6 additions and 4 deletions
|
@ -28,6 +28,7 @@
|
|||
#include <iostream>
|
||||
#include "Context.h"
|
||||
#include "Hooks.h"
|
||||
#include "Timer.h"
|
||||
|
||||
extern Context context;
|
||||
|
||||
|
@ -79,16 +80,15 @@ Hooks::~Hooks ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Enumerate all hooks, and tell API about the script files it must load in
|
||||
// order to call them. Note that API will perform a deferred read, which means
|
||||
// that if it isn't called, a script will not be loaded.
|
||||
void Hooks::initialize ()
|
||||
{
|
||||
#ifdef HAVE_LIBLUA
|
||||
api.initialize ();
|
||||
#endif
|
||||
|
||||
// TODO Enumerate all hooks, and tell API about the script files it must load
|
||||
// in order to call them. Note that API will perform a deferred read,
|
||||
// which means that if it isn't called, a script will not be loaded.
|
||||
|
||||
std::vector <std::string> vars;
|
||||
context.config.all (vars);
|
||||
|
||||
|
@ -148,6 +148,8 @@ bool Hooks::trigger (const std::string& event)
|
|||
{
|
||||
if (it->event == event)
|
||||
{
|
||||
Timer timer (std::string ("Hooks::trigger ") + event);
|
||||
|
||||
bool rc = true;
|
||||
std::string type;
|
||||
if (eventType (event, type))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue