diff options
Diffstat (limited to 'framework/actions/action.cpp')
-rw-r--r-- | framework/actions/action.cpp | 16 |
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 | ||
30 | using namespace Kube; | 32 | using namespace Kube; |
@@ -87,11 +89,21 @@ bool Action::ready() const | |||
87 | 89 | ||
88 | void Action::execute() | 90 | void Action::execute() |
89 | { | 91 | { |
90 | ActionBroker::instance().executeAction(mActionId, mContext); | 92 | ActionBroker::instance().executeAction(mActionId, mContext, mPreHandler, mPostHandler); |
91 | } | 93 | } |
92 | 94 | ||
93 | ActionResult Action::executeWithResult() | 95 | ActionResult Action::executeWithResult() |
94 | { | 96 | { |
95 | return ActionBroker::instance().executeAction(mActionId, mContext); | 97 | return ActionBroker::instance().executeAction(mActionId, mContext, mPreHandler, mPostHandler); |
98 | } | ||
99 | |||
100 | void Action::addPreHandler(ActionHandler *handler) | ||
101 | { | ||
102 | mPreHandler << handler; | ||
103 | } | ||
104 | |||
105 | void Action::addPostHandler(ActionHandler *handler) | ||
106 | { | ||
107 | mPostHandler << handler; | ||
96 | } | 108 | } |
97 | 109 | ||