From b1a2e2de201985a00980bead5272977cda4ef637 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 13 Dec 2016 14:52:27 +0100 Subject: Preactionhandler --- framework/actions/action.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'framework/actions/action.cpp') diff --git a/framework/actions/action.cpp b/framework/actions/action.cpp index 4bda033e..f41feb66 100644 --- a/framework/actions/action.cpp +++ b/framework/actions/action.cpp @@ -20,11 +20,13 @@ #include #include +#include #include #include #include #include "actionbroker.h" +#include "actionhandler.h" #include "context.h" using namespace Kube; @@ -87,11 +89,21 @@ bool Action::ready() const void Action::execute() { - ActionBroker::instance().executeAction(mActionId, mContext); + ActionBroker::instance().executeAction(mActionId, mContext, mPreHandler, mPostHandler); } ActionResult Action::executeWithResult() { - return ActionBroker::instance().executeAction(mActionId, mContext); + return ActionBroker::instance().executeAction(mActionId, mContext, mPreHandler, mPostHandler); +} + +void Action::addPreHandler(ActionHandler *handler) +{ + mPreHandler << handler; +} + +void Action::addPostHandler(ActionHandler *handler) +{ + mPostHandler << handler; } -- cgit v1.2.3