From 4b094beb151373abb4a24d473c6d69a11674c5ba Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 24 Feb 2016 12:37:51 +0100 Subject: Moved the ActionHandlerHelper --- framework/actions/actionhandler.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'framework/actions/actionhandler.cpp') diff --git a/framework/actions/actionhandler.cpp b/framework/actions/actionhandler.cpp index 748c2303..d4b01734 100644 --- a/framework/actions/actionhandler.cpp +++ b/framework/actions/actionhandler.cpp @@ -68,3 +68,23 @@ QByteArray ActionHandler::actionId() const { return mActionId; } + + + +ActionHandlerHelper::ActionHandlerHelper(const QByteArray &actionId, const IsReadyFunction &isReady, const Handler &handler) + : ActionHandler(nullptr), + isReadyFunction(isReady), + handlerFunction(handler) +{ + setActionId(actionId); +} + +bool ActionHandlerHelper::isActionReady(Context *context) +{ + return isReadyFunction(context); +} + +void ActionHandlerHelper::execute(Context *context) +{ + handlerFunction(context); +} -- cgit v1.2.3