summaryrefslogtreecommitdiffstats
path: root/framework/actions/actionbroker.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-05-03 20:24:09 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-05-03 20:24:26 +0200
commite06e1dad4a4570e5c1181d05ab6ed7a5d74c6c91 (patch)
treeef606d36ee693eff087292a1950fe122a7376f19 /framework/actions/actionbroker.cpp
parent21f7851f044cd8b6e38c821ce12d7e1b291cae27 (diff)
downloadkube-e06e1dad4a4570e5c1181d05ab6ed7a5d74c6c91.tar.gz
kube-e06e1dad4a4570e5c1181d05ab6ed7a5d74c6c91.zip
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.
Diffstat (limited to 'framework/actions/actionbroker.cpp')
-rw-r--r--framework/actions/actionbroker.cpp9
1 files changed, 7 insertions, 2 deletions
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)
54 return false; 54 return false;
55} 55}
56 56
57void ActionBroker::executeAction(const QByteArray &actionId, Context *context) 57ActionResult ActionBroker::executeAction(const QByteArray &actionId, Context *context)
58{ 58{
59 if (context) { 59 if (context) {
60 for (const auto handler : mHandler.values(actionId)) { 60 for (const auto handler : mHandler.values(actionId)) {
61 if (handler) { 61 if (handler) {
62 handler->execute(context); 62 //FIXME All handler together return one result
63 return handler->execute(context);
63 } 64 }
64 } 65 }
65 } else { 66 } else {
66 qWarning() << "Can't execute without context"; 67 qWarning() << "Can't execute without context";
67 } 68 }
69 ActionResult result;
70 result.setDone();
71 result.setError(1);
72 return result;
68} 73}
69 74
70void ActionBroker::registerHandler(const QByteArray &actionId, ActionHandler *handler) 75void ActionBroker::registerHandler(const QByteArray &actionId, ActionHandler *handler)