From e06e1dad4a4570e5c1181d05ab6ed7a5d74c6c91 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 3 May 2016 20:24:09 +0200 Subject: A save-as-draft action & action results This patch introduces tracking of actions, so they can be tested. It also provides a save-as-draft action, that looks for the draft folder, and stores the mail accordingly. --- framework/actions/actionhandler.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'framework/actions/actionhandler.h') diff --git a/framework/actions/actionhandler.h b/framework/actions/actionhandler.h index 1820bfd4..c8c10dc7 100644 --- a/framework/actions/actionhandler.h +++ b/framework/actions/actionhandler.h @@ -21,6 +21,9 @@ #include #include #include +#include + +#include "actionresult.h" namespace Kube { class Context; @@ -36,7 +39,7 @@ public: virtual bool isActionReady(Context *context); // void pre(Context *context); - virtual void execute(Context *context); + virtual ActionResult execute(Context *context); // void post(Context *context); void setActionId(const QByteArray &); @@ -52,14 +55,17 @@ class ActionHandlerHelper : public ActionHandler public: typedef std::function IsReadyFunction; typedef std::function Handler; + typedef std::function(Context*)> JobHandler; ActionHandlerHelper(const QByteArray &actionId, const IsReadyFunction &, const Handler &); + ActionHandlerHelper(const QByteArray &actionId, const IsReadyFunction &, const JobHandler &); bool isActionReady(Context *context) Q_DECL_OVERRIDE; - void execute(Context *context) Q_DECL_OVERRIDE; + ActionResult execute(Context *context) Q_DECL_OVERRIDE; private: - const std::function isReadyFunction; - const std::function handlerFunction; + const IsReadyFunction isReadyFunction; + const Handler handlerFunction; + const JobHandler jobHandlerFunction; }; } -- cgit v1.2.3