summaryrefslogtreecommitdiffstats
path: root/framework/actions/action.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-12-13 14:52:27 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-12-16 14:54:14 +0100
commitb1a2e2de201985a00980bead5272977cda4ef637 (patch)
tree9af03b622d8c5d6a3b3ed83efb846977813b58d8 /framework/actions/action.cpp
parent3f4626d305aa43c2a720d692cdf8cf89cc658181 (diff)
downloadkube-b1a2e2de201985a00980bead5272977cda4ef637.tar.gz
kube-b1a2e2de201985a00980bead5272977cda4ef637.zip
Preactionhandler
Diffstat (limited to 'framework/actions/action.cpp')
-rw-r--r--framework/actions/action.cpp16
1 files changed, 14 insertions, 2 deletions
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 @@
20 20
21#include <QDebug> 21#include <QDebug>
22#include <QEvent> 22#include <QEvent>
23#include <QPointer>
23#include <QDynamicPropertyChangeEvent> 24#include <QDynamicPropertyChangeEvent>
24#include <QMetaObject> 25#include <QMetaObject>
25#include <QMetaProperty> 26#include <QMetaProperty>
26 27
27#include "actionbroker.h" 28#include "actionbroker.h"
29#include "actionhandler.h"
28#include "context.h" 30#include "context.h"
29 31
30using namespace Kube; 32using namespace Kube;
@@ -87,11 +89,21 @@ bool Action::ready() const
87 89
88void Action::execute() 90void Action::execute()
89{ 91{
90 ActionBroker::instance().executeAction(mActionId, mContext); 92 ActionBroker::instance().executeAction(mActionId, mContext, mPreHandler, mPostHandler);
91} 93}
92 94
93ActionResult Action::executeWithResult() 95ActionResult Action::executeWithResult()
94{ 96{
95 return ActionBroker::instance().executeAction(mActionId, mContext); 97 return ActionBroker::instance().executeAction(mActionId, mContext, mPreHandler, mPostHandler);
98}
99
100void Action::addPreHandler(ActionHandler *handler)
101{
102 mPreHandler << handler;
103}
104
105void Action::addPostHandler(ActionHandler *handler)
106{
107 mPostHandler << handler;
96} 108}
97 109