diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-02-24 12:37:51 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-02-24 12:37:51 +0100 |
commit | 4b094beb151373abb4a24d473c6d69a11674c5ba (patch) | |
tree | 815b83ac455d5c62948f4ab02b33ea622567127f /framework/actions/actionhandler.cpp | |
parent | 37d1ff146cda492b02c6b199e1b33f671c1fa9f9 (diff) | |
download | kube-4b094beb151373abb4a24d473c6d69a11674c5ba.tar.gz kube-4b094beb151373abb4a24d473c6d69a11674c5ba.zip |
Moved the ActionHandlerHelper
Diffstat (limited to 'framework/actions/actionhandler.cpp')
-rw-r--r-- | framework/actions/actionhandler.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/framework/actions/actionhandler.cpp b/framework/actions/actionhandler.cpp index 748c2303..d4b01734 100644 --- a/framework/actions/actionhandler.cpp +++ b/framework/actions/actionhandler.cpp | |||
@@ -68,3 +68,23 @@ QByteArray ActionHandler::actionId() const | |||
68 | { | 68 | { |
69 | return mActionId; | 69 | return mActionId; |
70 | } | 70 | } |
71 | |||
72 | |||
73 | |||
74 | ActionHandlerHelper::ActionHandlerHelper(const QByteArray &actionId, const IsReadyFunction &isReady, const Handler &handler) | ||
75 | : ActionHandler(nullptr), | ||
76 | isReadyFunction(isReady), | ||
77 | handlerFunction(handler) | ||
78 | { | ||
79 | setActionId(actionId); | ||
80 | } | ||
81 | |||
82 | bool ActionHandlerHelper::isActionReady(Context *context) | ||
83 | { | ||
84 | return isReadyFunction(context); | ||
85 | } | ||
86 | |||
87 | void ActionHandlerHelper::execute(Context *context) | ||
88 | { | ||
89 | handlerFunction(context); | ||
90 | } | ||