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/actionbroker.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'framework/actions/actionbroker.cpp') diff --git a/framework/actions/actionbroker.cpp b/framework/actions/actionbroker.cpp index 43a535a1..890a5566 100644 --- a/framework/actions/actionbroker.cpp +++ b/framework/actions/actionbroker.cpp @@ -54,17 +54,22 @@ bool ActionBroker::isActionReady(const QByteArray &actionId, Context *context) return false; } -void ActionBroker::executeAction(const QByteArray &actionId, Context *context) +ActionResult ActionBroker::executeAction(const QByteArray &actionId, Context *context) { if (context) { for (const auto handler : mHandler.values(actionId)) { if (handler) { - handler->execute(context); + //FIXME All handler together return one result + return handler->execute(context); } } } else { qWarning() << "Can't execute without context"; } + ActionResult result; + result.setDone(); + result.setError(1); + return result; } void ActionBroker::registerHandler(const QByteArray &actionId, ActionHandler *handler) -- cgit v1.2.3